Selecting text in any Qt app corrupts the content. This happens only on Fedora atm.
STEPS TO REPRODUCE
Create a new text file “test.txt” with a few lines of text.
Open “test.txt” with Kate or Kwrite application
Move your mouse cursor to the beginning of a line
Hold down the left mouse button to start selection
Drag the mouse while still holding the left mouse button to the right to select the text in the line
Release the left mouse button at the end of the line.
OBSERVED RESULT
The first word of the line is corrupted when selecting. You will notice the “Undo” button activating when it happened as a symptom.
EXPECTED RESULT
Selecting text with mouse works as expected even when the selection starts from the very first character in the line.
I can say all Qt apps are affected, but it is not a Qt issue, because the same Qt version works fine on EndeavourOS
Seems like it is not a KDE related issue
So it might be a weird combination in Fedora, I am just guessing at this point. But it’s not KDE, and not Qt as far as I can tell, more likely it is something with Wayland
Example with Kate (it is just one of the affected apps!):
I can’t reproduce this on my desktop with a mouse, but I can on my laptop (both with touchpad and with mouse). Both are Fedora 43 KDE with all updates applied.
I’ll experiment a bit more and see if I can get any more clues.
I only get the specific behaviour in your video when the line starts with some kind of “bracket” character (( or [ or < all do it, but normal alphabetical characters don’t).
I can reproduce the behaviour purely using the keyboard. i.e. if I have a text file identical to yours, then I put the cursor at the top left, hold down Shift and hit the right arrow a couple of times – no mouse involved – then I also see the < disappear.
Sometimes when clicking and dragging, I see a string from the clipboard be pasted in. My first thought was “middle-click paste gone haywire”. But disabling middle-click paste doesn’t make any difference.
Are these the same as you see?
(1) and (2) make me wonder if it’s related to Kate and KWrite trying to do “syntax-aware” things with brackets. But that doesn’t explain why my two different machines with the same software versions behave differently.
I see that the “<” is removed as I select the text.
So they seem to have more then one selection related problem.
I think progressing these issues has to be done with reports directly to the KDE folks.
Starting on https://discuss.kde.org/ and filing bug reports if you ask for them in the KDE bug tracker.
The only catch I wonder about is that in the existing KDE bug report for this, everyone reporting the issue is using Fedora, and folks running Arch and Ubuntu-based systems can’t reproduce it.
Is it possible that something related to Qt versions present when building vs. when running is at play? I seem to remember some funky issues occurring in the past when Qt updated and dependent programs weren’t rebuilt with the new version - although this issue seemed to appear before the Qt 6.10.2 update got rolled out?
This affects all Qt based apps, Kate and Kwrite are just the easiest to demonstrate with.
If you click into the address bar in Dolphin, and you try to select the path from left to right, you will see the first forward slash character vanish.
Similar issue can be observed with any Qt dialog like file/folder rename dialogs.
So based on the symptoms it has nothing to do with syntax highlight, see this other example with plain text where the selection skips the first word (note that the Undo button appears!):
I did open this on KDE bugtracker, but so far it seems like it is not a KDE issue. Me and others have no idea where it’s coming from, but comment #19 touched on something!
If I set the environment variable QT_QPA_PLATFORM=xcb in a terminal window and start kwrite from there, the problem is gone, but just for the kwrite instance(s) started from that specific terminal window.
It is my guess that the weird selection problem and the corruption issue originates from the same root cause. In both cases some weird input is happening into the text editor control.
I don’t use on-screen keyboard but I noticed that the Virtual Keyboard mode in System Settings was set to “Plasma Keyboard”. (This is a recent addition I think - previously I’d only seen the “None”, “iBus Wayland” and “Malit” options.)
When I changed this to “None”, the problem disappeared.
However, something weird is still going on with these settings. If I return to that settings screen, it no longer says “None” but has apparently reverted to “Plasma Keyboard”. But (even after rebooting) the original problem doesn’t recur.
I can make it recur by changing to “iBus Wayland” and then changing to “Plasma Keyboard”.
Interesting… I have no option / choice of “Virtual Keyboard” in my KDE Keyboard - System Settings… Only “Keyboard”, “On-Screen Keyboard” and “Shortcuts”….
I also had the issue in KDE-43 and Kinoite 43 and have it in Kinoite 44 and in Kinoite 45.
My solution was:
In KDE-Settings - Keyboard - Virtual keyboard I selected none and rebooted.
But, after the reboot the same setting is placed back to Plasma keyboard.
The error is gone however, I can now select the whole line of text including the first characters, with and without special characters like brackets.
Turns out, the reboot is not necessary, just selecting None instead of Plasma keyboard for the Virtual keyboard setting does the trick.
After a reboot the settings returns to Plasma keyboard but the error is stil gone.