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

Input system does scans only the first layout for symbols #1745

Open
twaik opened this issue Apr 14, 2024 · 3 comments
Open

Input system does scans only the first layout for symbols #1745

twaik opened this issue Apr 14, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@twaik
Copy link

twaik commented Apr 14, 2024

Describe the bug
Hello. It seems like when you try to input symbol from layout which is not selected as current layout X server does not even try to scan secondary (or non-selected) layout and to use it. Only primary layout and it's shift levels are being used.

To Reproduce

  1. Start server with vncserver -SecurityTypes None -xstartup xterm -fg.
  2. Start xev in xterm window.
  3. Use setxkbmap us,ru on both main and vncserver's X servers.
  4. Switch to russian layout with alt-shift (if alt-shift toggle is configured) or use your DE's layout switcher (only on main X server).
  5. Try to input russian symbols in xev's window.

Xev will show you scratch (fake?) keycodes and not real keycodes that you can reproduce on your local X server.

Expected behavior
X server should scan secondary layouts to find symbols and switch layouts when needed.

Screenshots
image

Client (please complete the following information):

  • OS: Kubuntu 23.10
  • VNC client: KRDC 23.08.1
  • Client downloaded from: apt

Server (please complete the following information):

  • OS: Kubuntu 23.10 but it is not relevant.
  • VNC server: Xvnc TigerVNC 1.12.0 - built 2024-01-23 17:21, underlying X server release 12101007, X.Org
  • Server downloaded from: apt
  • Server was started using: vncserver -SecurityTypes None -xstartup xterm -fg

Additional context
N/a

@CendioOssman
Copy link
Member

XKB's group system is rather complex, but it could be worth exploring if this could be used. Switching group isn't as obvious as the other states, though, so I'm not sure exactly what needs to be done here.

@CendioOssman CendioOssman added the enhancement New feature or request label Apr 30, 2024
@CendioOssman
Copy link
Member

This could be a mitigation for #93.

@twaik
Copy link
Author

twaik commented Apr 30, 2024

I implemented scanning layouts and switching layout before inputting symbol (in XCB, not on X server side) a while ago, I hope it will be helpful.
https://github.com/termux/termux-x11/blob/62bf17ddf8a8cacd945f8ef3fa9e91cec42fa39c/app/src/main/cpp/lorie/xcb-connection.hpp#L254-L515
The most interesting parts are reload_keymaps (which scans the whole keymap table including all layouts) and send_keysym which sends symbols with changing layout before sending key event and restoring it after that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants