[mutter] keybindings: Add "no-auto-grab" type
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] keybindings: Add "no-auto-grab" type
- Date: Thu, 18 Jul 2019 13:55:33 +0000 (UTC)
commit 1c3d8defb5adeb84a0f58d571edc8fc8eb340dce
Author: Olivier Fourdan <ofourdan redhat com>
Date: Mon Jul 15 17:24:35 2019 +0200
keybindings: Add "no-auto-grab" type
Some special modifiers (typically "Control_L" used for locate-pointer in
mutter/gnome-shell or "Super_L" for overlay) must be handled separately
from the rest of the key bindings.
Add a new flag `META_KEY_BINDING_NO_AUTO_GRAB` so we can tell when
dealing with that special keybinding which should not be grabbed
automatically like the rest of the keybindings, and skip those when
changing the grabs of all keybindings.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/685
src/core/keybindings.c | 6 ++++++
src/meta/prefs.h | 2 ++
2 files changed, 8 insertions(+)
---
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index e474b25c7..2526d04a3 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -1463,6 +1463,12 @@ change_keygrab_foreach (gpointer key,
if (data->only_per_window != binding_is_per_window)
return;
+ /* Ignore the key bindings marked as META_KEY_BINDING_NO_AUTO_GRAB,
+ * those are handled separately
+ */
+ if (binding->flags & META_KEY_BINDING_NO_AUTO_GRAB)
+ return;
+
if (binding->resolved_combo.len == 0)
return;
diff --git a/src/meta/prefs.h b/src/meta/prefs.h
index 9db540453..36ebc1fa1 100644
--- a/src/meta/prefs.h
+++ b/src/meta/prefs.h
@@ -436,6 +436,7 @@ typedef enum _MetaKeyBindingAction
* @META_KEY_BINDING_BUILTIN: built-in
* @META_KEY_BINDING_IS_REVERSED: is reversed
* @META_KEY_BINDING_NON_MASKABLE: always active
+ * @META_KEY_BINDING_NO_AUTO_GRAB: not grabbed automatically
*/
typedef enum
{
@@ -445,6 +446,7 @@ typedef enum
META_KEY_BINDING_IS_REVERSED = 1 << 2,
META_KEY_BINDING_NON_MASKABLE = 1 << 3,
META_KEY_BINDING_IGNORE_AUTOREPEAT = 1 << 4,
+ META_KEY_BINDING_NO_AUTO_GRAB = 1 << 5,
} MetaKeyBindingFlags;
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]