Bug 484992 - Xwayland gets keyboard events even when they're filtered out by an input event filter
Summary: Xwayland gets keyboard events even when they're filtered out by an input even...
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: input (show other bugs)
Version: 6.0.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 486263 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-04-03 16:23 UTC by mailport+kdebugs
Modified: 2024-05-03 20:55 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mailport+kdebugs 2024-04-03 16:23:06 UTC
# SUMMARY

When the current focus in in an XWayland application/windows and I switch to the over-next window (by pressing Alt+Tab+Tab) the second tab will also be registered inside the application

# STEPS TO REPRODUCE

1. Open a xwayland application (preferably one with a textarea input - for easier debugging).
2. Set the input focus into the textarea.
3. Press Alt+Tab+Tab to switch two windows further (aka HOLD-ALT PRESS-TAG PRESS-TAB RELEASE-ALT)
4. Go back to the original window and observe that one tab was pressed 

# OBSERVED RESULT

The second tab of the Alt-Tab-Tab was forwarded (?) to the original window

# EXPECTED RESULT

The task-switcher should "swallow" the key presses (the first tab seems to be swallowed, but not all further presses)

# SOFTWARE/OS VERSIONS

KDE Plasma Version:  6.0.3
KDE Frameworks Version:  6.0.0
Qt Version:  6.6.3
Kernel Version: 6.8.2-arch2-1 (64-bit)
Graphics Platform: Wayland

# ADDITIONAL OBSERVATIONS

 - This only works in XWayland windows (confirmed in IntelliJ Goland, Webstorm, Bitwarden, MongoDB Compass, non-wayland-VSCodium)

 - In native Wayland applications I can't reproduce it (aka firefox, Dolphin, Konsole, ....)

 - The bug is not specific to the tab key, If I [HOLD-ALT] [Tab] [ARROW-DOWN] [ARROW-DOWN] [RELEASE-ALT], then the two arrow presses do also appear in the original application

 - The task-switcher behaves completely normal during all this - meaning both applications (teh task-switcher and the originally focused window) receive the key press

 - Does not happen when I switch to X11

 - Does happen independent which task switcher I chose in the settings (tested "Modern Informative", Compact, "Thumbnail Grid")

 - It happens consistently, I can reproduce it every time I try
Comment 1 Zamundaaa 2024-04-22 14:13:09 UTC
Can confirm, though it only happens if you set X11 apps to always be able to read all keystrokes
Comment 2 mailport+kdebugs 2024-04-22 14:22:01 UTC
(In reply to Zamundaaa from comment #1)
> Can confirm, though it only happens if you set X11 apps to always be able to
> read all keystrokes

Wow - thanks Zamundaaa. That actually fixes my problem (even though I had the option "Any key typed while Control/Alt/Meta are pressed" selected). But switching to "Never" completely fixes it.

You can't believe how annoying the last week was, I think in every project of mine are now random tabs committed.
Really thank you - lol, send me you postal address and I'll mail you a box of chocolate.
Comment 3 Kevin Schier 2024-04-25 12:53:30 UTC
Also happens for me when using the overview feature or desktop grid. First input gets properly intercepted while all following keys "leak" through.
Comment 4 Zamundaaa 2024-04-28 23:10:29 UTC
*** Bug 486263 has been marked as a duplicate of this bug. ***