Bug 499772 - kdiff3 1.12.0 glitches with some merge conflicts
Summary: kdiff3 1.12.0 glitches with some merge conflicts
Status: CONFIRMED
Alias: None
Product: kdiff3
Classification: Applications
Component: application (other bugs)
Version First Reported In: 1.12.0
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: michael
URL:
Keywords: regression
: 506355 507065 (view as bug list)
Depends on:
Blocks: 507065
  Show dependency treegraph
 
Reported: 2025-02-10 18:45 UTC by darkbasic
Modified: 2025-11-19 12:32 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
screenshot of the issue (48.41 KB, image/png)
2025-02-10 18:45 UTC, darkbasic
Details
video of issue (3.75 MB, video/mp4)
2025-07-23 13:17 UTC, jonaskarlsson
Details
Files that reproduce the issue (1.86 KB, text/plain)
2025-11-19 12:32 UTC, Helga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description darkbasic 2025-02-10 18:45:44 UTC
Created attachment 178121 [details]
screenshot of the issue

SUMMARY


STEPS TO REPRODUCE
1. Depends on the merge conflict
2. 
3. 

OBSERVED RESULT
Sometimes when I rebase/merge a branch some files with merge conflicts open in the mergetool (kdiff3) with visual glitches (in the attached screenshot you can see the black from the Console behind, like if it was transparent).
Also the buttons in the menu on the top appear to be grayed out and cannot be clicked.
When trying to resolve merge conflicts on other files it works flawlessly.
I can reproduce the issue whenever I try to solve the same conflict.


EXPECTED RESULT
It shouldn't glitch.


SOFTWARE/OS VERSIONS
I use Gnome on Arch Linux

ADDITIONAL INFORMATION
I tried to recompile the kdiff package, same issue. I tried to recompile an older version of kdiff3 (1.11.5) and it works flawlessly.
Comment 1 Samuel Jimenez 2025-02-21 15:50:05 UTC
Able to reproduce with KDE Plasma 6.3.1
Comment 2 JATothrim 2025-06-02 14:10:19 UTC
When resolving merge conflicts using kdiff3 version 1.12.3, I have observed similar results to those shown at https://bugs.kde.org/attachment.cgi?id=178121. I use kdiff3 as the Git merge tool.

When the bug occurs, the kdiff3 starts up but the text views are missing. Restarting kdiff3 on such a merge reliably produces this result each time and I have to resolve the file manually when this happens.
Comment 3 Helga 2025-06-04 09:58:17 UTC
I have just hit upon this issue in kdiff3 1.12.2 in Kubuntu 25.04 (Plasma 6.3.4, Frameworks 6.12.0, Qt 6.8.3, Gear 24.12.3) with Wayland.

Logging out and logging back in from KDE(X11), however, this issue doesn't come up on the same merge conflict.

Since git mergetool creates _LOCAL, _REMOTE, _BASE files and then runs `kdiff3 $LOCAL $REMOTE $BASE -o $MERGED`, would be nice to attach files for which this reproduces to this ticket. Unfortunately, I cannot do this myself because the code I'm working on is non-FOSS.
Comment 4 jonaskarlsson 2025-07-23 13:17:13 UTC
Created attachment 183456 [details]
video of issue

I attached a video of the issue. I have created three local files for the diff that I open in kdiff3 inbetween calling git mergetool, but it seems the bug only happens when calling kdiff3 from git. Also it seems that depending on the size of the window it will glitch out or not. I cannot tell if there is a pattern or if it is just random. Maybe the issue is that the popup is blocked?
Comment 5 Petr Menšík 2025-08-05 16:31:45 UTC
It seems I have hit the same issue with 1.12.3 version in Fedora 41. I were able to track that at least on my system, it happens only when --auto mode is used. When I added --noauto, it renders okay. Unfortunately there does not seem to be simple way to add --noauto into git mergetool.

My Fedora bug with my screenshots: https://bugzilla.redhat.com/show_bug.cgi?id=2386547

Strange is it happens on my computer only when I did maximize the window in previous run. If I made the window smaller, it renders okay next time. If I maximize the window again and close, then next time it is broken.

It may need a bit more text with scrollbar. It did not appear with short text, but visible on conflict file not tiny. It worked reliably on 412 lines long glibc license file. My primary screen is 2560x1440 pixels Lenovo, if that matters.

My Steps to Reproduce:
1. cp /usr/share/licenses/glibc/LICENSES L
2. cp L L2
3. cp L L3
4. echo "# make diff" >> L3
5. /usr/bin/kdiff3 --auto -o L L2 L3 
6. if it renders, maximize window and restart with the same parameters.
Comment 6 Petr Menšík 2025-08-05 16:33:53 UTC
*** Bug 507065 has been marked as a duplicate of this bug. ***
Comment 7 Petr Menšík 2025-08-05 16:39:42 UTC
good thing is this can be avoided by using --noauto parameter. But I have not found simple way to add it from git. It might be possible to avoid it by shell wrapper:

```
#!/bin/sh
[ "$1" = "--auto" ] && shift
exec /usr/bin/kdiff3 "$@"
```

Not sure why, --noauto always rendered correctly to me. Avoiding --auto might require me to save it and close unnecessary, but at least I see the text on conflicts.
Comment 8 Petr Menšík 2025-08-05 16:42:34 UTC
*** Bug 506355 has been marked as a duplicate of this bug. ***
Comment 9 Petr Menšík 2025-08-05 16:48:31 UTC
This issue were not happening on version before 1.12.0. I think 1.11.5 had other issues, but at least always rendered the text.
Comment 10 Petr Menšík 2025-08-05 18:32:49 UTC
Note:

Bug 507065 contains also commit references to the cause of this issue.

https://bugs.kde.org/show_bug.cgi?id=507065#c1
Comment 11 Petr Menšík 2025-08-06 09:41:40 UTC
Ah, there exists even simpler workaround. Just enable Word Wrap Diff Windows in Diffview menu. (3rd from bottom).

Bruno has identified correctly commit https://github.com/KDE/kdiff3/commit/1ae607daa4c2153bbf88295fae153aa08f3bd5b#r163513079 is responsible for this change. It seems it negated word wrapping condition by mistake. Toggling it to avoid using  getVisibleTextAreaWidth() call seems to fix the rendering also. At least to me.
Comment 12 Gleb Popov 2025-10-20 10:16:15 UTC
It started to happen much more often for me with recent updates. Having "Word Wrap" flag set does not help the issue either. Can something be done about this bug, please?
Comment 13 jonaskarlsson 2025-10-22 11:55:52 UTC
Have you tried the latest git version? This commit https://invent.kde.org/sdk/kdiff3/-/commit/b6e97aeb2541f770fe114467259df44e46413862 should fix the bug.
Comment 14 Szőts Ákos 2025-11-13 22:25:12 UTC
I have kdiff3 1.12.3 that still reproduces this issue. It seems the referenced commit is from 4 months ago. Do you know whether 1.12.3 should already contain it?
Comment 15 jonaskarlsson 2025-11-14 00:42:38 UTC
No released version contains the fix. See https://invent.kde.org/sdk/kdiff3/-/commits/1.12?ref_type=heads
Comment 16 Helga 2025-11-19 12:32:30 UTC
(In reply to jonaskarlsson from comment #13)
> Have you tried the latest git version? This commit
> https://invent.kde.org/sdk/kdiff3/-/commit/
> b6e97aeb2541f770fe114467259df44e46413862 should fix the bug.

I have tried it just now - kdiff3 built with commit 6045e1cd4fa484a77e35c5eb8f25f8a5a6aa838c, which includes b6e97aeb2541f770fe114467259df44e46413862 in history. Issue still reproduces.

I have also found a cmdline and file examples that reproduce this issue - files will be attached as kdiff3-499772-repro.tar.gz, cmdline is as follows:

kdiff3 --auto --L1 "vsftpd.init (Base)" --L2 "vsftpd.init (Local)" --L3 "vsftpd.init (Remote)" -o vsftpd.init ./vsftpd_BASE_78355.init ./vsftpd_LOCAL_78355.init ./vsftpd_REMOTE_78355.init
Comment 17 Helga 2025-11-19 12:32:38 UTC
Created attachment 186948 [details]
Files that reproduce the issue