[mutter] keybinding: Store flags in MetaKeyGrab



commit 1c2e8fcf060f3a68865fd832357a919994dcb131
Author: Andrea Azzarone <azzaronea gmail com>
Date:   Fri Aug 24 22:20:13 2018 +0300

    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

 src/core/keybindings.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index dfd440d3a..5ffe4110d 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -203,6 +203,7 @@ struct _MetaKeyGrab {
   char *name;
   guint action;
   MetaKeyCombo combo;
+  gint flags;
 };
 
 static void
@@ -834,7 +835,7 @@ rebuild_binding_table (MetaKeyBindingManager *keys,
           b = g_slice_new0 (MetaKeyBinding);
           b->name = grab->name;
           b->handler = handler;
-          b->flags = handler->flags;
+          b->flags = grab->flags;
           b->combo = grab->combo;
 
           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->name = meta_external_binding_name_for_action (grab->action);
   grab->combo = combo;
+  grab->flags = flags;
 
   g_hash_table_insert (external_grabs, grab->name, grab);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]