Bug 509714 - Sticky Keys lock state under Wayland does not result in shifted keys
Summary: Sticky Keys lock state under Wayland does not result in shifted keys
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: input (other bugs)
Version First Reported In: 6.4.5
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: accessibility
Depends on:
Blocks:
 
Reported: 2025-09-20 13:47 UTC by Sapphire Cat
Modified: 2025-09-24 15:15 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sapphire Cat 2025-09-20 13:47:22 UTC
SUMMARY

Kubuntu (including 25.10 beta) does not handle the lock state correctly for sticky keys under Wayland.

STEPS TO REPRODUCE
1. Start a Plasma Wayland session, configure Sticky Keys as enabled + lock modifier keys enabled
2. Open a text input (e.g. Konsole; I think it will reproduce in all text inputs, but I usually open Konsole to test with)
3. Press in sequence (one key at a time): SHIFT SHIFT a - b SHIFT x

OBSERVED RESULT

a-bx

EXPECTED RESULT

A_Bx

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: As distributed in Ubuntu 24.10 (IIRC) – 25.10 beta
KDE Plasma Version:
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION

The final "SHIFT X" in the reproduction section shows that the lock state is being handled correctly: this 3rd press of SHIFT unlocks the state, so the next key should appear un-shifted.  If there were a different error, the result would be a capital X.  The use of the dash distinguishes the sticky-keys behavior from Caps Lock.

Please let me know if you need exact software/os versions from apt, or would like me to try a different distro (if it can run from a live USB.)

Not a duplicate: bug 464452 appears to be about implementing the state tracking itself.  Bug 444335 is potentially related, but marked fixed in 2024, while this problem persists in 2025.  Bug 34991 predates Wayland.
Comment 1 Sapphire Cat 2025-09-21 15:46:34 UTC
I have also reported this downstream: https://bugs.launchpad.net/ubuntu/+source/kwin/+bug/2125291

While doing the research on that, I found more info:

1. It's definitely any text input, e.g. Firefox location bar and form fields, Kate, etc.  It is not app-specific nor toolkit-specific.
2. The Lock Keys Status applet in the tray reflects the incorrect results: when pressing SHIFT the second time, it disappears from the tray, instead of remaining but changing from "Latched" to "Locked."

On an X11 session, the applet (and locked state) function as expected.
Comment 2 Bug Janitor Service 2025-09-22 15:30:50 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8142
Comment 3 Zamundaaa 2025-09-24 13:36:38 UTC
Git commit 5f48d5ba511a29064efd8ca3c55c1d283a2be12e by Xaver Hugl.
Committed on 24/09/2025 at 12:36.
Pushed by zamundaaa into branch 'master'.

autotests/integration: make the sticky keys test more complete

And fix modifier state caused by sticky keys not being reported to keystate
protocol users.
Sticky key locking still doesn't work properly with this, as we lock keys on
press, but libkxbcommon afterwards unlocks keys on release. The relevant checks
in the test are commented out until that's fixed.

M  +2    -1    autotests/integration/CMakeLists.txt
M  +20   -0    autotests/integration/kwin_wayland_test.h
M  +33   -10   autotests/integration/sticky_keys_test.cpp
M  +26   -0    autotests/integration/test_helpers.cpp
M  +16   -2    src/plugins/stickykeys/stickykeys.cpp

https://invent.kde.org/plasma/kwin/-/commit/5f48d5ba511a29064efd8ca3c55c1d283a2be12e
Comment 4 Bug Janitor Service 2025-09-24 14:31:37 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8150
Comment 5 Zamundaaa 2025-09-24 15:15:48 UTC
Git commit 837e0849504836cfb728c6655f8eedf01e45dc89 by Xaver Hugl.
Committed on 24/09/2025 at 14:30.
Pushed by zamundaaa into branch 'Plasma/6.5'.

autotests/integration: make the sticky keys test more complete

And fix modifier state caused by sticky keys not being reported to keystate
protocol users.
Sticky key locking still doesn't work properly with this, as we lock keys on
press, but libkxbcommon afterwards unlocks keys on release. The relevant checks
in the test are commented out until that's fixed.


(cherry picked from commit 5f48d5ba511a29064efd8ca3c55c1d283a2be12e)

Co-authored-by: Xaver Hugl <xaver.hugl@kde.org>

M  +2    -1    autotests/integration/CMakeLists.txt
M  +20   -0    autotests/integration/kwin_wayland_test.h
M  +33   -10   autotests/integration/sticky_keys_test.cpp
M  +26   -0    autotests/integration/test_helpers.cpp
M  +16   -2    src/plugins/stickykeys/stickykeys.cpp

https://invent.kde.org/plasma/kwin/-/commit/837e0849504836cfb728c6655f8eedf01e45dc89