diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 97a04afd2..f750b2fca 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -1499,6 +1499,18 @@ process_overlay_key (MetaDisplay *display, /* We want to unfreeze events, but keep the grab so that if the user * starts typing into the overlay we get all the keys */ XAllowEvents (display->xdisplay, AsyncKeyboard, event->xkey.time); + + if (display->grab_op == META_GRAB_OP_COMPOSITOR) + { + MetaKeyBinding *binding = + display_get_keybinding (display, + display->overlay_key_combo.keysym, + display->overlay_key_combo.keycode, + display->grab_mask); + if (binding && + meta_compositor_filter_keybinding (display->compositor, screen, binding)) + return TRUE; + } meta_display_overlay_key_activate (display); } @@ -4221,6 +4233,8 @@ init_builtin_key_bindings (MetaDisplay *display) void meta_display_init_keys (MetaDisplay *display) { + MetaKeyHandler *handler; + /* Keybindings */ display->keymap = NULL; display->keysyms_per_keycode = 0; @@ -4250,6 +4264,13 @@ meta_display_init_keys (MetaDisplay *display) key_handlers = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) key_handler_free); + + handler = g_new0 (MetaKeyHandler, 1); + handler->name = g_strdup ("overlay-key"); + handler->flags = META_KEY_BINDING_BUILTIN; + + g_hash_table_insert (key_handlers, g_strdup ("overlay-key"), handler); + init_builtin_key_bindings (display); rebuild_key_binding_table (display); diff --git a/src/core/prefs.c b/src/core/prefs.c index f21bd4330..fadf01fc4 100644 --- a/src/core/prefs.c +++ b/src/core/prefs.c @@ -1702,8 +1702,18 @@ meta_key_pref_free (MetaKeyPref *pref) static void init_bindings (void) { + MetaKeyPref *pref; + key_bindings = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)meta_key_pref_free); + + pref = g_new0 (MetaKeyPref, 1); + pref->name = g_strdup ("overlay-key"); + pref->action = META_KEYBINDING_ACTION_OVERLAY_KEY; + pref->bindings = g_slist_prepend (pref->bindings, &overlay_key_combo); + pref->builtin = 1; + + g_hash_table_insert (key_bindings, g_strdup ("overlay-key"), pref); } static void