| Summary: | XWayland apps get stray keystrokes if you release modifier before shortcut character | ||
|---|---|---|---|
| Product: | [Plasma] kwin | Reporter: | nyanpasu64 <nyanpasu64> |
| Component: | xwayland | Assignee: | KWin default assignee <kwin-bugs-null> |
| Status: | CONFIRMED --- | ||
| Severity: | normal | CC: | kde49861515, kdedev, nate, safinaskar |
| Priority: | NOR | ||
| Version First Reported In: | 6.4.5 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Video of the Ctrl+A bug happening on Plasma 6.5.80. | ||
|
Description
nyanpasu64
2025-10-08 20:27:30 UTC
FWIW I haven't succeeded at reproducing the issue with those exact steps. :/ When you launch `xinput test-xi2 --root` in a terminal and perform the steps before 4, do you at least get key repeats without C held down? (If you use Konsole as the Wayland app, you may need to type Ctrl-A to avoid killing the program.) I started seeing this today in git-master, copying from Firefox to Obsidian Notes (flatpak) I was able to reproduce this using exact steps in "STEPS TO REPRODUCE". The bug is totally reproducible, you just need to have patience. Try a lot of times, and you will succeed in this. Try various ways to type that "Ctrl+C". I. e. try to release C right after Ctrl. Also try to release C right after Ctrl, but not quite right after, etc. I. e. try various durations between releasing C and releasing Ctrl. I used Chromium 140.0.7339.127 (it is Wayland-native app by default in this version) and xterm (it runs under xwayland) as my test apps. Operating System: Debian GNU/Linux 13 KDE Plasma Version: 6.3.6 KDE Frameworks Version: 6.13.0 Qt Version: 6.8.2 Kernel Version: 6.12.43+deb13-amd64 (64-bit) Graphics Platform: Wayland Processors: 32 × 13th Gen Intel® Core™ i9-13950HX Memory: 64 GiB of RAM (62.5 GiB usable) Graphics Processor: Intel® Graphics Manufacturer: Dell Inc. Product Name: Precision 7780 (In reply to nyanpasu64 from comment #0) > SUMMARY Does this happen if you set "Allow legacy X11 apps to read keystrokes typed in all apps:" to "Never"? If I set "Allow legacy X11 apps to read keystrokes typed in all apps:" to "Never", `xinput test-xi2 --root` never reports keystrokes for Ctrl *or* A entered in a Wayland app, so X11 apps can't get stray keystrokes through the mechanism I described. To confirm, I tried the "Ctrl+A + !Ctrl + !A, click in Obsidian" dance 20 times and did not receive a stray keypress, meaning the bug does not appear to happen. (In reply to nyanpasu64 from comment #6) > If I set "Allow legacy X11 apps to read keystrokes typed in all apps:" to Thank you! (In reply to nyanpasu64 from comment #6) > If I set "Allow legacy X11 apps to read keystrokes typed in all apps:" to And if you set to "Only Meta, Control, Alt and Shift keys"? (I'm attempting to come up with working configuration for me.) Thank you in advance My preferred workaround is to set it to Always. But I *think* any option other than "any key typed when (modifiers)" is unaffected, since that's the only option that *conditionally* allows keystrokes to be sent to Xwayland (so a key release can be missed). this may be similar to what I'm observing with https://bugs.kde.org/show_bug.cgi?id=511684 my setting is currently "only the meta, control, alt and shift keys", and "listening for mouse buttons" is checked - I need this combination to let Mumble capture push to talk whilst not being in focus, however alt+tab is randomly acting funky causing my mouse forward / back events to be sent to multiple windows and I have to refocus the bugged window to get it to stop I'll try the "as above, plus any key pressed while the control, alt, or meta key is also pressed" option, and failing that I'll try "always allowed" In my case, the only option that stops the input from being sent to the xwayland windows as well is to set Legacy X11 app support to "disabled". In every other case the input is still being dispatched to the windows that are not in focus |