From b6200ac3ff6dd7279f5de3869111cee54c5c7174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 1 Nov 2017 11:03:18 +0800 Subject: [PATCH] wayland/keyboard: Don't transfer layout group when replacing xkb state The layout group determines what actual keyboard layout in the keymap to use when translating modifier state and key codes to key syms. When changing a keymap to another, the layout groups has no relation to the layout groups in the old keymap, thus there is no reason to transfer it to the new state. This fixes an issue where the xkb state in meta-wayland-keyboard.c got desynchronized with the xkb state in clutter-device-manager-evdev.c. https://bugzilla.gnome.org/show_bug.cgi?id=789300 --- src/wayland/meta-wayland-keyboard.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c index f8042dc65..a6c861906 100644 --- a/src/wayland/meta-wayland-keyboard.c +++ b/src/wayland/meta-wayland-keyboard.c @@ -478,23 +478,24 @@ static void meta_wayland_keyboard_update_xkb_state (MetaWaylandKeyboard *keyboard) { MetaWaylandXkbInfo *xkb_info = &keyboard->xkb_info; - xkb_mod_mask_t latched, locked, group; + xkb_mod_mask_t latched, locked; /* Preserve latched/locked modifiers state */ if (xkb_info->state) { latched = xkb_state_serialize_mods (xkb_info->state, XKB_STATE_MODS_LATCHED); locked = xkb_state_serialize_mods (xkb_info->state, XKB_STATE_MODS_LOCKED); - group = xkb_state_serialize_layout (xkb_info->state, XKB_STATE_LAYOUT_EFFECTIVE); xkb_state_unref (xkb_info->state); } else - latched = locked = group = 0; + { + latched = locked = 0; + } xkb_info->state = xkb_state_new (xkb_info->keymap); - if (latched || locked || group) - xkb_state_update_mask (xkb_info->state, 0, latched, locked, 0, 0, group); + if (latched || locked) + xkb_state_update_mask (xkb_info->state, 0, latched, locked, 0, 0, 0); } static void