[mutter] Add meta_display_get_grab_op()



commit d042dba4d69a6987b9ae91764706986abdf65753
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Fri Aug 28 11:25:51 2009 -0400

    Add meta_display_get_grab_op()
    
    Add a function to determine the current grab op. This can be useful
    in a plugin to avoid over-grabbing an X grab held by Mutter.
    
    http://bugzilla.gnome.org/show_bug.cgi?id=593399

 src/core/display.c    |   15 +++++++++++++++
 src/include/display.h |    4 ++++
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 3b09645..b84f16f 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -3725,6 +3725,21 @@ meta_display_end_grab_op (MetaDisplay *display,
     }
 }
 
+/**
+ * meta_display_get_grab_op:
+ * Gets the current grab operation, if any.
+ *
+ * Return value: the current grab operation, or %META_GRAB_OP_NONE if
+ * Mutter doesn't currently have a grab. %META_GRAB_OP_COMPOSITOR will
+ * be returned if a compositor-plugin modal operation is in effect
+ * (See mutter_begin_modal_for_plugin())
+ */
+MetaGrabOp
+meta_display_get_grab_op (MetaDisplay *display)
+{
+  return display->grab_op;
+}
+
 void
 meta_display_check_threshold_reached (MetaDisplay *display,
                                       int          x,
diff --git a/src/include/display.h b/src/include/display.h
index d05a030..c0a0f0d 100644
--- a/src/include/display.h
+++ b/src/include/display.h
@@ -114,6 +114,10 @@ gboolean meta_display_begin_grab_op (MetaDisplay *display,
                                      int          root_y);
 void     meta_display_end_grab_op   (MetaDisplay *display,
                                      guint32      timestamp);
+
+MetaGrabOp meta_display_get_grab_op (MetaDisplay *display);
+
+
 /* meta_display_set_input_focus_window is like XSetInputFocus, except
  * that (a) it can't detect timestamps later than the current time,
  * since Mutter isn't part of the XServer, and thus gives erroneous



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