[mutter/wip/halfline/fix-xkb-changemap-call] meta-keymap-x11: Don't update key types when adding key to keymap




commit 43e221c314d321a21f0a027c72101b58f89a84e7
Author: Ray Strode <rstrode redhat com>
Date:   Mon Oct 4 14:53:04 2021 -0400

    meta-keymap-x11: Don't update key types when adding key to keymap
    
    meta_keymap_x11_replace_keycode currently reports to the X server
    that the key types data is changed when adding a key to the keymap.
    
    It's not changed. The number of key types is the same, and none of
    them are modified.
    
    This has two bad side effects:
    
    1) It sends all of the key types data into the request
    2) It hits a bug in the X server leading to the request getting
    rejected entirely.  See:
    
    https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/761
    
    Furthmore, the changed structure used to report to the X server
    that the key types data is changed doesn't actually need to modified
    at all in the function.  It's already prepped by libX11 with the
    correct state for the changes mutter is doing when
    XkbChangeTypesOfKey is called.
    
    This commit addresses the above two problems by just removing the
    lines causing the issues.

 src/backends/x11/meta-keymap-x11.c | 5 -----
 1 file changed, 5 deletions(-)
---
diff --git a/src/backends/x11/meta-keymap-x11.c b/src/backends/x11/meta-keymap-x11.c
index 994ad85943..0638b47f41 100644
--- a/src/backends/x11/meta-keymap-x11.c
+++ b/src/backends/x11/meta-keymap-x11.c
@@ -471,11 +471,6 @@ meta_keymap_x11_replace_keycode (MetaKeymapX11 *keymap_x11,
           XkbChangeTypesOfKey (xkb, keycode, 0, XkbGroup1Mask, NULL, &changes);
         }
 
-      changes.changed = XkbKeySymsMask | XkbKeyTypesMask;
-      changes.first_key_sym = keycode;
-      changes.num_key_syms = 1;
-      changes.first_type = 0;
-      changes.num_types = xkb->map->num_types;
       XkbChangeMap (xdisplay, xkb, &changes);
 
       XFlush (xdisplay);


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