SUMMARY *** NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols. See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports *** STEPS TO REPRODUCE 1. Set "All" to X11 legacy app support under kwin wayland 2. start xinput test-xi2 --root 3. first press any key like "a", and see modifier line is "base 0". 4. make sure alt+tab is set for window switching, and the focused window is wayland window. 5. press alt + tab with alt being held. 6. release all key. 7. press "a" again OBSERVED RESULT After that, the any key pressed is with "modifier base 0x8", which means alt mask is set. Press alt again will make the state back to normal. EXPECTED RESULT modifier is return to "base 0" because alt is released. SOFTWARE/OS VERSIONS Linux/KDE Plasma: 5.90.0 (available in About System) KDE Plasma Version: 5.90.0 KDE Frameworks Version: 5.246.0 Qt Version: 6.6.1 ADDITIONAL INFORMATION I suspect that alt is not forwarded to xwayland at all since kwin captured it for alt+tab, and later xwayland's key state is kept in a wrong state until the next X window is focused.
Can reproduce
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5322
Git commit 2025bf4c6b99950e104eb0fd79992bb3912ae3a4 by David Edmundson. Committed on 03/03/2024 at 12:41. Pushed by davidedmundson into branch 'master'. xwayland: Send to xwayland even when no window is focussed In the codepath to keep xwayland notified of key presses we have to check the focussed window is not already an xwayland client. To avoid a null dereference a guard is added that the focussed window is not null, however the current code incorrectly returns early intead of skipping just the relevant check. M +24 -23 src/xwayland/xwayland.cpp https://invent.kde.org/plasma/kwin/-/commit/2025bf4c6b99950e104eb0fd79992bb3912ae3a4
Git commit 18e6256dd6a3c97b57180319edbe5f8559892556 by Vlad Zahorodnii, on behalf of David Edmundson. Committed on 06/03/2024 at 12:42. Pushed by vladz into branch 'Plasma/6.0'. xwayland: Send to xwayland even when no window is focussed In the codepath to keep xwayland notified of key presses we have to check the focussed window is not already an xwayland client. To avoid a null dereference a guard is added that the focussed window is not null, however the current code incorrectly returns early intead of skipping just the relevant check. M +16 -15 src/xwayland/xwayland.cpp https://invent.kde.org/plasma/kwin/-/commit/18e6256dd6a3c97b57180319edbe5f8559892556
*** Bug 479011 has been marked as a duplicate of this bug. ***