Public bug reported:
On Ubuntu 26.04 with deskflow 1.26.0+dfsg-1 running as the server in a
KDE Plasma Wayland session, clients always get Num Lock and Caps Lock as
off, whatever the server keyboard says.
[Impact]
Every time the cursor crosses to a client, the server's lock state is
lost. Numpad keys arrive as KP_End, KP_Down and so on, so the client
gets cursor movement instead of digits, and Caps Lock is ignored on
letters. Pressing Num Lock while on the client only helps until the
cursor leaves and comes back. That makes the numpad unusable on a client
driven from a Wayland server.
The cause is in src/lib/platform/EiKeyState.cpp. The xkb state only learns lock
keys from key events the server itself sees, and it is cleared at every screen
leave, so the lock bits in the mask are always 0. Upstream fixed this with two
commits, both in 1.27.0:
- f8edc7b0ae90 "fix: preserve locked modifiers in Wayland key state" (deskflow
PR 10011)
- ac475f0b1b54 "fix(wayland): sync locked modifiers from EI keyboard modifiers
event" (deskflow PR 10152)
Moving to 1.27.0 isn't a good answer for 26.04 users. It drops the wl-
clipboard backend, which breaks clipboard sharing with KDE as the server
(deskflow issue 10315). Backporting the two commits to 1.26.0 would fix
this without that regression.
[Test Plan]
1. On 26.04 with Plasma on Wayland, run deskflow as the server, with a client
on any OS.
2. Turn Num Lock on at the server, move to the client, and press numpad 1-9.
Expected: digits. Currently: cursor movement.
3. Turn Caps Lock on at the server and type letters on the client. Expected:
uppercase. Currently: lowercase.
4. Move the cursor back and forth a few times and repeat. The result should not
change.
[Where problems could occur]
The change touches only the Wayland/libei key state (EiKeyState,
EiScreen). X11 servers and all client code are untouched. A mistake
would show up as wrong modifier state on Wayland servers: stuck or
missing lock or Shift state on clients. On GNOME the second commit has
no effect, because Mutter doesn't send the EI modifiers event (Mutter
issue 3375), so GNOME behavior shouldn't change.
[Other Info]
I worked around it locally by rebuilding 1.26.0 with a small patch that
reads the lock state from /sys/class/leds/*::numlock and *::capslock.
That confirms the diagnosis, but it isn't what upstream did. I haven't
tried applying the two upstream commits to 1.26.0, so they may need
minor rebasing.
Environment: Ubuntu 26.04.1, kernel 7.0, KDE Plasma / KWin 6.6.7
(Wayland), libei 1.5.0, xdg-desktop-portal 1.21.1, deskflow
1.26.0+dfsg-1 (universe) as the server, Windows 11 26H2 client.
** Affects: deskflow (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2175505
Title:
Wayland server: Num Lock / Caps Lock always sent as off to clients
(fixed upstream in 1.27.0)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/deskflow/+bug/2175505/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs