From c8f015c6d7b98b041152afc11c3a3ecc823547b2 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Tue, 2 Sep 2014 18:11:31 +0200 Subject: [PATCH] keybindings: Ignore extra modifier bits when matching iso_next_group Clutter events include the layout index codified into modifier_state, unlike XI2 device events, which means that we need to mask it out so that we can match successfully. --- src/core/keybindings.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/keybindings.c b/src/core/keybindings.c index fe7eccd70..1dc80fc17 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -1877,6 +1877,8 @@ process_iso_next_group (MetaDisplay *display, { MetaKeyBindingManager *keys = &display->key_binding_manager; gboolean activate; + guint32 keycode; + guint32 modifiers; int i; if (event->type == CLUTTER_KEY_RELEASE) @@ -1884,10 +1886,13 @@ process_iso_next_group (MetaDisplay *display, activate = FALSE; + keycode = event->hardware_keycode; + modifiers = event->modifier_state & 0xff & ~keys->ignored_modifier_mask; + for (i = 0; i < keys->n_iso_next_group_combos; ++i) { - if (event->hardware_keycode == keys->iso_next_group_combos[i].keycode && - event->modifier_state == (unsigned int)keys->iso_next_group_combos[i].modifiers) + if (keycode == keys->iso_next_group_combos[i].keycode && + modifiers == keys->iso_next_group_combos[i].modifiers) { /* If the signal handler returns TRUE the keyboard will remain frozen. It's the signal handler's responsibility