gdk/wayland: Always get the seat's key modifiers from the GdkKeymap

Elsewhere we already go through the keymap to get modifiers so we
should do the same here. In fact, this was relying on xkb modifier
mask values being bitwise compatible with GdkModifierType which isn't
necessarily true.

https://bugzilla.gnome.org/show_bug.cgi?id=770112
This commit is contained in:
Rui Matos 2017-01-11 19:12:12 +01:00 committed by Bastien Nocera
parent 515b71f14c
commit 7a1b30f16e

View File

@ -2233,10 +2233,11 @@ keyboard_handle_modifiers (void *data,
keymap = seat->keymap; keymap = seat->keymap;
direction = gdk_keymap_get_direction (keymap); direction = gdk_keymap_get_direction (keymap);
xkb_state = _gdk_wayland_keymap_get_xkb_state (keymap); xkb_state = _gdk_wayland_keymap_get_xkb_state (keymap);
seat->key_modifiers = mods_depressed | mods_latched | mods_locked;
xkb_state_update_mask (xkb_state, mods_depressed, mods_latched, mods_locked, group, 0, 0); xkb_state_update_mask (xkb_state, mods_depressed, mods_latched, mods_locked, group, 0, 0);
seat->key_modifiers = gdk_keymap_get_modifier_state (keymap);
g_signal_emit_by_name (keymap, "state-changed"); g_signal_emit_by_name (keymap, "state-changed");
if (direction != gdk_keymap_get_direction (keymap)) if (direction != gdk_keymap_get_direction (keymap))
g_signal_emit_by_name (keymap, "direction-changed"); g_signal_emit_by_name (keymap, "direction-changed");