[mutter] backends/x11: Interpret keycode correctly



commit 72cfe9b3fd7439914838537f66422e3a1fa20508
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Sun Feb 14 17:57:49 2021 +0100

    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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1732>

 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 9ae6554cdb..fe60408590 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]