From 6c3985220ecc685595bc2c02af60ffe4a6d7d0c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 10 Aug 2012 22:08:03 +0200 Subject: [PATCH] keybindings: Add MetaKeybindingAction for overview-key Currently gnome-shell hardcodes 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(+) diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 3c6c86d29..157eddf65 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 156f72862..bbbe76868 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;