[mutter] keybindings: Add MetaKeybindingAction for overview-key



commit 6c3985220ecc685595bc2c02af60ffe4a6d7d0c1
Author: Florian MÃllner <fmuellner gnome org>
Date:   Fri Aug 10 22:08:03 2012 +0200

    keybindings: Add MetaKeybindingAction for overview-key
    
    Currently gnome-shell hardcodes <super> as overlay key when it has
    a keyboard grab. In order to fix this, add a corresponding keybinding
    action.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=665547

 src/core/keybindings.c |    9 +++++++++
 src/meta/prefs.h       |    1 +
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 3c6c86d..157eddf 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -665,6 +665,15 @@ meta_display_get_keybinding_action (MetaDisplay  *display,
   MetaKeyBinding *binding;
   KeySym keysym;
 
+  /* This is much more vague than the MetaDisplay::overlay-key signal,
+   * which is only emitted if the overlay-key is the only key pressed;
+   * as this method is primarily intended for plugins to allow processing
+   * of mutter keybindings while holding a grab, the overlay-key-only-pressed
+   * tracking is left to the plugin here.
+   */
+  if (keycode == display->overlay_key_combo.keycode)
+    return META_KEYBINDING_ACTION_OVERLAY_KEY;
+
   keysym = XKeycodeToKeysym (display->xdisplay, keycode, 0);
   mask = mask & 0xff & ~display->ignored_modifier_mask;
   binding = display_get_keybinding (display, keysym, keycode, mask);
diff --git a/src/meta/prefs.h b/src/meta/prefs.h
index 156f728..bbbe768 100644
--- a/src/meta/prefs.h
+++ b/src/meta/prefs.h
@@ -221,6 +221,7 @@ typedef enum _MetaKeyBindingAction
   META_KEYBINDING_ACTION_MOVE_TO_SIDE_E,
   META_KEYBINDING_ACTION_MOVE_TO_SIDE_W,
   META_KEYBINDING_ACTION_MOVE_TO_CENTER,
+  META_KEYBINDING_ACTION_OVERLAY_KEY,
 
   META_KEYBINDING_ACTION_LAST
 } MetaKeyBindingAction;



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