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
This commit is contained in:
Jonas Ådahl 2017-11-01 11:03:18 +08:00
parent 626621a53a
commit b6200ac3ff

View File

@ -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