From c1f5e57f2b3962790fe87fa96bc89c46254932d9 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Mon, 4 Oct 2021 14:53:04 -0400 Subject: [PATCH] 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. Part-of: --- 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 d40400305..89542e859 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);