TigerVNC / tigervnc

High performance, multi-platform VNC client and server
https://tigervnc.org
GNU General Public License v2.0
4.85k stars 907 forks source link

Improve unknown keysym handling by reusing keycodes #1734

Open gujjwal00 opened 4 months ago

gujjwal00 commented 4 months ago

This is still a work in progress, but I am kinda stuck on how to handle Xvnc. Atleast x0vncserver works correctly. As proposed in https://github.com/TigerVNC/tigervnc/issues/93#issuecomment-1472362126, when all free keys has been used, it will start reusing the oldest key assigned by TigerVNC.

For Xvnc, I have tried a few things:

Issue: #93

gujjwal00 commented 2 months ago

I have added separate implementations for x0vnceserver & xvnc.

Trying to share this piece of code creates too many problems because both servers are using different headers, different way of getting/updating keymaps, and different build systems.

gujjwal00 commented 6 days ago

Re-based onto latest master branch.

Have you checked that the naming resets when you modiify the keyboard layout using other tools?

Yes, changing layout via setxkbmap will reset the naming. Basically, any operation which triggers reload of XKB configuration from disk will reset in-memory changes done by Tigervnc. Please note that in case of multi-layout configuration, fast layout switching via key shortcut doesn't reload the configuration from disk, it only changes the active group. But its not an issue here because Tigervnc only modifies unused keys.

gujjwal00 commented 5 days ago

Also, only Xvnc assigns key name to added keys. x0vncserver simply updates the keysym. But if needed, same approach could be used in x0vncserver too.