[mutter/wip/xinput2r: 18/68] compositor: Use helper functions for input events



commit 0040c8ea4320cc32664c496f4cfc3a88e3234bf1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Jun 11 18:51:51 2011 +0200

    compositor: Use helper functions for input events

 src/compositor/compositor.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index e0e9b71..f96c77d 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -18,6 +18,7 @@
 #include "meta-background-actor-private.h"
 #include "window-private.h" /* to check window->hidden */
 #include "display-private.h" /* for meta_display_lookup_x_window() */
+#include "input-events.h"
 #include <X11/extensions/shape.h>
 #include <X11/extensions/Xcomposite.h>
 
@@ -695,9 +696,15 @@ meta_compositor_set_updates (MetaCompositor *compositor,
 }
 
 static gboolean
-is_grabbed_event (XEvent *event)
+is_grabbed_event (MetaDisplay *display,
+                  XEvent      *event)
 {
-  switch (event->xany.type)
+  guint evtype;
+
+  if (!meta_input_event_get_type (display, event, &evtype))
+    return FALSE;
+
+  switch (evtype)
     {
     case ButtonPress:
     case ButtonRelease:
@@ -730,7 +737,8 @@ meta_compositor_process_event (MetaCompositor *compositor,
                                XEvent         *event,
                                MetaWindow     *window)
 {
-  if (compositor->modal_plugin && is_grabbed_event (event))
+  if (compositor->modal_plugin &&
+      is_grabbed_event (compositor->display, event))
     {
       MetaPluginClass *klass = META_PLUGIN_GET_CLASS (compositor->modal_plugin);
 



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