1
0
Fork 0

keybinding: Store flags in MetaKeyGrab

The external grab handler is shared across all external bindings and external
bindings have now different binding flags. For this reason, when rebuilding the
binding table there could be loss of information if we assign the bindings flags
of the external handler to all external bindings. Let's store the bindings flags
in MetaKeyGrab too and use this when rebuilding the binding table to avoid the
above issue.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/169
This commit is contained in:
Andrea Azzarone 2018-08-24 22:20:13 +03:00 committed by Carlos Garnacho
parent 00ca387ec7
commit 1c2e8fcf06

View file

@ -203,6 +203,7 @@ struct _MetaKeyGrab {
char *name; char *name;
guint action; guint action;
MetaKeyCombo combo; MetaKeyCombo combo;
gint flags;
}; };
static void static void
@ -834,7 +835,7 @@ rebuild_binding_table (MetaKeyBindingManager *keys,
b = g_slice_new0 (MetaKeyBinding); b = g_slice_new0 (MetaKeyBinding);
b->name = grab->name; b->name = grab->name;
b->handler = handler; b->handler = handler;
b->flags = handler->flags; b->flags = grab->flags;
b->combo = grab->combo; b->combo = grab->combo;
g_hash_table_add (keys->key_bindings, b); g_hash_table_add (keys->key_bindings, b);
@ -1629,6 +1630,7 @@ meta_display_grab_accelerator (MetaDisplay *display,
grab->action = next_dynamic_keybinding_action (); grab->action = next_dynamic_keybinding_action ();
grab->name = meta_external_binding_name_for_action (grab->action); grab->name = meta_external_binding_name_for_action (grab->action);
grab->combo = combo; grab->combo = combo;
grab->flags = flags;
g_hash_table_insert (external_grabs, grab->name, grab); g_hash_table_insert (external_grabs, grab->name, grab);