From 72cfe9b3fd7439914838537f66422e3a1fa20508 Mon Sep 17 00:00:00 2001 From: Pascal Nowack Date: Sun, 14 Feb 2021 17:57:49 +0100 Subject: [PATCH] backends/x11: Interpret keycode correctly Currently, when a remote desktop user submits a keycode, it will be interpreted differently, when using the x11 session, instead of a wayland session. In a wayland session, submitting a keycode will have the expected result (as if the key was pressed locally). In a x11 session, this is not the case. Instead of getting the expected key, some other key will be pressed (or sometimes even none). The reason for this is that the native backend interprets the keycode as evdev keycode and the x11 backend interprets the keycode as xkb keycode. To ensure that both backends produce the same behaviour when submitting a keycode, fix the x11 backend to always interpret the keycode as evdev keycode, instead of a xkb keycode. Part-of: --- src/backends/x11/meta-virtual-input-device-x11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/x11/meta-virtual-input-device-x11.c b/src/backends/x11/meta-virtual-input-device-x11.c index 9ae6554cd..fe6040859 100644 --- a/src/backends/x11/meta-virtual-input-device-x11.c +++ b/src/backends/x11/meta-virtual-input-device-x11.c @@ -159,7 +159,7 @@ meta_virtual_input_device_x11_notify_key (ClutterVirtualInputDevice *virtual_dev ClutterKeyState key_state) { XTestFakeKeyEvent (clutter_x11_get_default_display (), - key, key_state == CLUTTER_KEY_STATE_PRESSED, 0); + key + 8, key_state == CLUTTER_KEY_STATE_PRESSED, 0); } static void