From 5819e74c220b7cc13b65486db033d6579f981c13 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 8c03b4ae1..26b81f7ae 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -18,6 +18,7 @@ #include "meta-background-actor.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 @@ -658,9 +659,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: @@ -683,7 +690,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);