From 324d9fdb141b39ad86db2e8c3b512008a20d2d52 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sat, 11 Jun 2011 18:51:51 +0200 Subject: [PATCH] compositor: Use helper functions for input events --- src/compositor/compositor.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index e0e9b7177..f96c77d8e 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 #include @@ -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);