Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard layout switching not working on Ubuntu 24.04 #4462

Closed
kpushkaryov opened this issue Jan 8, 2025 · 1 comment · Fixed by #4463
Closed

Keyboard layout switching not working on Ubuntu 24.04 #4462

kpushkaryov opened this issue Jan 8, 2025 · 1 comment · Fixed by #4463
Labels
bug Something isn't working

Comments

@kpushkaryov
Copy link
Contributor

Describe the bug
I have US and RU keyboard layouts set up on client and server side, switched by Caps Lock shortcut. Switching has stopped working after I've upgraded xpra from 3.1.5+dfsg1-0.2ubuntu1 (Ubuntu package) to 6.2.2-r0-1 (xpra package).

Both client and server are on Ubuntu 24.04 with Xorg.

The root cause seems to be a bug of inverted condition at https://github.com/Xpra-org/xpra/blame/master/xpra/x11/server/core.py#L249 introduced in 84a5a81, which causes skipping of the X11Keyboard.set_layout_group(grp) call.

I've fixed the condition on my server and that solved the issue.

To Reproduce
Steps to reproduce the behavior:

  1. xpra start :10 --daemon=no -d keyboard
  2. xpra attach ssh://.../10 --start=xterm
  3. Press layout switching shortcut.
  4. Type Cyrillic letters.

System Information (please complete the following information):

  • Server OS: Ubuntu 24.04
  • Client OS: Ubuntu 24.04
  • Xpra Server Version 6.2.2-r0
  • Xpra Client Version 6.2.2-r0

Additional context
I've enabled keyboard debug logging on the server. I see that Cyrillic letters are actually received by the server:

2025-01-08 12:49:41,604 handle_key((1, True, 'Cyrillic_shorti', 1738, 24, ['mod2'], False, True))
2025-01-08 12:49:41,605 handle keycode pressing    24: key 'Cyrillic_shorti'
2025-01-08 12:49:41,605 fake_key(24, True)
2025-01-08 12:49:41,770 process_key_action(('key-action', 1, 'Cyrillic_shorti', False, ('mod2',), 1738, 'й', 24, 1)) server keycode=24, group=1
2025-01-08 12:49:41,770 set_keyboard_layout_group(1) ignored, value unchanged
2025-01-08 12:49:41,771 filtered_modifiers_set(['mod2'])={'mod2'}
2025-01-08 12:49:41,771 filtered_modifiers_set(['mod2'])={'mod2'}
2025-01-08 12:49:41,771 is_modifier(24) not found
2025-01-08 12:49:41,772 handle_key((1, False, 'Cyrillic_shorti', 1738, 24, ['mod2'], False, True))
2025-01-08 12:49:41,772 handle keycode unpressing  24: key 'Cyrillic_shorti'
2025-01-08 12:49:41,772 fake_key(24, False)

But Latin letters are printed anyways.

My problem is similar to #4445, #3857 (comment).

@kpushkaryov kpushkaryov added the bug Something isn't working label Jan 8, 2025
@totaam
Copy link
Collaborator

totaam commented Jan 8, 2025

Thanks!

I never use this feature and I have no idea how I would test it.

This fix is so obviously correct that I have already backported it to older branches, and partially pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants