[mutter] [MetaDisplay] Expose meta_display_get_keybinding_action



commit 650a1e807c105a791079fe77e6733a2c567e8ddd
Author: Colin Walters <walters verbum org>
Date:   Tue Mar 16 18:05:13 2010 -0400

    [MetaDisplay] Expose meta_display_get_keybinding_action
    
    This can be used when a plugin has control of input to determine
    what action would be done, and thus filter to a subset of them.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=613100

 src/core/keybindings.c |   28 +++++++++++++++++++---------
 src/include/display.h  |    5 +++++
 2 files changed, 24 insertions(+), 9 deletions(-)
---
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 7a3b829..11827f4 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -499,11 +499,21 @@ display_get_keybinding (MetaDisplay  *display,
   return NULL;
 }
 
-static MetaKeyBindingAction
-display_get_keybinding_action (MetaDisplay  *display,
-                               unsigned int  keysym,
-                               unsigned int  keycode,
-                               unsigned long mask)
+/**
+ * meta_display_get_keybinding_action:
+ * @display: A #MetaDisplay
+ * @keysym: Key symbol
+ * @keycode: Raw keycode
+ * @mask: Event mask
+ *
+ * Returns: The action that should be taken for the given key, or %META_KEYBINDING_ACTION_NONE.
+ *
+ */
+MetaKeyBindingAction
+meta_display_get_keybinding_action (MetaDisplay  *display,
+                                    unsigned int  keysym,
+                                    unsigned int  keycode,
+                                    unsigned long mask)
 {
   MetaKeyBinding *binding;
 
@@ -2756,10 +2766,10 @@ process_workspace_switch_grab (MetaDisplay *display,
       MetaWorkspace *target_workspace;
       MetaKeyBindingAction action;
 
-      action = display_get_keybinding_action (display,
-                                              keysym,
-                                              event->xkey.keycode,
-                                              display->grab_mask);
+      action = meta_display_get_keybinding_action (display,
+                                                   keysym,
+                                                   event->xkey.keycode,
+                                                   display->grab_mask);
 
       switch (action)
         {
diff --git a/src/include/display.h b/src/include/display.h
index c0a0f0d..c30e6ae 100644
--- a/src/include/display.h
+++ b/src/include/display.h
@@ -26,6 +26,7 @@
 #include <X11/Xlib.h>
 
 #include "types.h"
+#include "prefs.h"
 #include "common.h"
 
 typedef enum
@@ -117,6 +118,10 @@ void     meta_display_end_grab_op   (MetaDisplay *display,
 
 MetaGrabOp meta_display_get_grab_op (MetaDisplay *display);
 
+MetaKeyBindingAction meta_display_get_keybinding_action (MetaDisplay  *display,
+                                                         unsigned int  keysym,
+                                                         unsigned int  keycode,
+                                                         unsigned long mask);
 
 /* meta_display_set_input_focus_window is like XSetInputFocus, except
  * that (a) it can't detect timestamps later than the current time,



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