From f88c20f335d25156a272a3f2ac922e1662b6cc17 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 14 Aug 2014 15:52:32 -0400 Subject: [PATCH] keybindings: Add an accessor for window grab modifiers Since we're going to seal it away in the future. --- src/core/keybindings-private.h | 2 ++ src/core/keybindings.c | 6 ++++++ src/core/window.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/keybindings-private.h b/src/core/keybindings-private.h index 1e6816f71..01b45ffa6 100644 --- a/src/core/keybindings-private.h +++ b/src/core/keybindings-private.h @@ -106,6 +106,8 @@ gboolean meta_keybindings_process_event (MetaDisplay *display, void meta_display_process_mapping_event (MetaDisplay *display, XEvent *event); +ClutterModifierType meta_display_get_window_grab_modifiers (MetaDisplay *display); + gboolean meta_prefs_add_keybinding (const char *name, GSettings *settings, MetaKeyBindingAction action, diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 87b2660a2..e3524c23b 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -1013,6 +1013,12 @@ meta_change_button_grab (MetaDisplay *display, } } +ClutterModifierType +meta_display_get_window_grab_modifiers (MetaDisplay *display) +{ + return display->window_grab_modifiers; +} + void meta_display_grab_window_buttons (MetaDisplay *display, Window xwindow) diff --git a/src/core/window.c b/src/core/window.c index 127dc2afd..129a56c5c 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -6113,7 +6113,7 @@ button_event_is_window_grab (MetaDisplay *display, const ClutterEvent *event) { ClutterModifierType mods = event->button.modifier_state; - ClutterModifierType grab_mods = display->window_grab_modifiers; + ClutterModifierType grab_mods = meta_display_get_window_grab_modifiers (display); return (mods & grab_mods) == grab_mods; }