TigerVNC / tigervnc

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

Stops sending clipboard to remote if xkb configuration on remote is modified #1875

Open philippefutureboy opened 2 days ago

philippefutureboy commented 2 days ago

Describe the bug Modifying the keycodes associated to control keys on the remote host (Ubuntu + Xfce4) makes clipboard sync from local (MacOS) to remote (Linux) stop working; remote to local clipboard sync keeps working.

I decided to change the keycodes so that I can keep my mac shortcuts when on the remote (Cmd_L can still be used to do Cmd+C, Cmd+V, etc.; Option_L can be used as Alt_L on Linux). The change allows me to keep my workflow without switching shortcuts from one machine to another.

To Reproduce Steps to reproduce the behavior:

Given an X11 session on remote:

/usr/bin/x11vnc \
    -forever \
    -display :0 \
    -auth guess \
    -rfbport 5900 \
    -noxdamage \
    -pipeinput UINPUT:direct_key=/dev/input/event2,direct_abs=/dev/input/event3 \
    -overlay \
    -repeat \
    -cursor_drag \
    -nocursorshape \
    -usepw \
    -ncache 10 \
    -ncache_cr \
    -clip 1920x1080

with dbus-x11 installed and lightdm as session manager,

  1. Edit /usr/share/X11/xkb/keycodes/evdev; Replace the keycodes for and for another keycode of your choice (for me it was 105 and 64 respectively, using a Logi MX Mini keyboard).
  2. Save the file, run setxkbmap to update the keymap
  3. Logout
  4. Reconnect to the remote
  5. Attempt to copy from local (MacOS) to remote - Notice that the clipboard is not sent over
  6. Attempt on the remote to copy some content (e.g. from a notepad like app like Mousepad or Gedit) and paste (copy and paste on the remote) - see that the new keyboard mapping works as intended
  7. Attempt on the local to paste - see that the clipboard content of the remote has been copied back to the local clipboard.

(I confirm the clipboard works locally from local to local)

Expected behavior

Clipboard should work both ways if Options > Input > Accept clipboard from server and Options > Input > Send clipboard to server are checked. Especially since the change in keymapping is done on the remote, not the local??

Two ways to go about it:

  1. Determine and fix the source of current bug
  2. (Or to achieve my desired result of having the same keyboard shortcuts as on my Mac): Support ability to remap key strokes sent to the remote (maybe directly use an .Xmodmap?)

Screenshots N/A

Client (please complete the following information):

Server (please complete the following information):

Additional context Add any other context about the problem here.

CendioOssman commented 1 day ago

Thank you for your report.

If the issue happens when you modify things on the server, then this sounds like a server issue. What leads you do suspect an issue with TigerVNC?