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.
This commit is contained in:
Rui Matos 2014-09-02 18:11:31 +02:00
parent 604d2155ba
commit c8f015c6d7

View File

@ -1877,6 +1877,8 @@ process_iso_next_group (MetaDisplay *display,
{ {
MetaKeyBindingManager *keys = &display->key_binding_manager; MetaKeyBindingManager *keys = &display->key_binding_manager;
gboolean activate; gboolean activate;
guint32 keycode;
guint32 modifiers;
int i; int i;
if (event->type == CLUTTER_KEY_RELEASE) if (event->type == CLUTTER_KEY_RELEASE)
@ -1884,10 +1886,13 @@ process_iso_next_group (MetaDisplay *display,
activate = FALSE; 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) for (i = 0; i < keys->n_iso_next_group_combos; ++i)
{ {
if (event->hardware_keycode == keys->iso_next_group_combos[i].keycode && if (keycode == keys->iso_next_group_combos[i].keycode &&
event->modifier_state == (unsigned int)keys->iso_next_group_combos[i].modifiers) modifiers == keys->iso_next_group_combos[i].modifiers)
{ {
/* If the signal handler returns TRUE the keyboard will /* If the signal handler returns TRUE the keyboard will
remain frozen. It's the signal handler's responsibility remain frozen. It's the signal handler's responsibility