Bug 7985 - Caps lock/Num lock synchronisation doesn't work
Summary: Caps lock/Num lock synchronisation doesn't work
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: VNC (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.19.0
Assignee: Bugzilla mail exporter
URL:
Keywords: adaha_tester, relnotes
Depends on: 8485
Blocks: keyboard
  Show dependency treegraph
 
Reported: 2022-08-30 10:08 CEST by Pierre Ossman
Modified: 2025-02-26 09:17 CET (History)
1 user (show)

See Also:
Acceptance Criteria:
MUST: * CapsLock/NumLock synchronization should occur seamlessly between the client and server.


Attachments

Description Pierre Ossman cendio 2022-08-30 10:08:17 CEST
ThinLinc 4.10.0 (via bug 400) got support for synchronising the state of the lock keys (caps lock, num lock, scroll lock) between the server and the client. This solves some special corner cases.

Unfortunately, we accidentally broke this in ThinLinc 4.12.0 in bug 7373 when some debug code was accidentally left in.

The upstream commit breaking this is this one:

https://github.com/TigerVNC/tigervnc/commit/81e114f29f007c689a41ca2bb72f314d50898381

Things have mostly worked fine anyway, since it is rare this synchronisation matters. We also added some fallback handling in bug 400 that further minimises when issues arise.
Comment 1 Pierre Ossman cendio 2022-08-30 10:11:23 CEST
To test this:

1. Connect to a session
2. Switch to a different window locally
3. Switch lock state (e.g. enable caps lock)
4. Switch focus back to the client

At this point, the lock state on the server should immediately change (check for fake key events via xev), but it currently doesn't.

Fake key events are now instead sent when the server detects that something is off. Generally, when you press a letter key.
Comment 3 Adam Halim cendio 2025-02-24 13:45:55 CET
Tested server build 3925 on RHEL 9 and client build 3815 on F40 GNOME Wayland.

Something seems off:
1. Connect to a session
2. Switch to a different window locally
3. Switch lock state (e.g. enable caps lock)
4. Switch focus back to the client

As described in comment #1, the lock state should now be synced, but it does not change immediately for me. I had to switch focus twice, and the sync always happened on the second focus:

1. Connect to a session
2. Switch to a different window locally
3. Switch lock state (e.g. enable caps lock)
4. Switch focus back to the client
5. Lock state is not synced, I see fake key events-
6. Switch to a different window locally
7. Switch focus back to client
8. Lock state is now synced

I could reproduce this on KDE and GNOME sessions.
Comment 4 Adam Halim cendio 2025-02-24 14:11:48 CET
Tested Windows 10 and macOS 15 and could not see this issue. Synchronization
happens as soon as you switch focus to the client again.

I decided to test a F41 client:
* KDE   Wayland OK
* MATE  X11     OK
* GNOME X11     OK
* GNOME Wayland Fail, need to switch focus twice.

This suggests that there is an issue somewhere in GNOME.
Comment 5 Adam Halim cendio 2025-02-24 14:17:51 CET
Tested Windows 10 and macOS 15 and could not see this issue. Synchronization
happens as soon as you switch focus to the client again.

I decided to test a F41 client:
* KDE   Wayland OK
* MATE  X11     OK
* GNOME X11     OK
* GNOME Wayland Fail, need to switch focus twice.

I've broken out this issue to bug 8527.
Comment 7 Adam Halim cendio 2025-02-25 09:34:23 CET
> MUST:
>   * CapsLock/NumLock synchronization should
>     occur seamlessly between the client
>     and server.
With the GNOME Wayland issue moved to bug 8527, I'd consider this bug to be fixed.

Note You need to log in before you can comment on or make changes to this bug.