From dec83013fc83de3b95a3aaae8e9d1943052ba82d Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Fri, 31 Oct 2008 18:02:52 +0000 Subject: [PATCH] Add an xevent_filter method to our plugin By default, mutter doesn't pass events to clutter. We need to add an xevent_filter method to our plugin and do that ourselves. svn path=/trunk/; revision=7 --- src/gnome-shell-plugin.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gnome-shell-plugin.c b/src/gnome-shell-plugin.c index 5ff0a5a92..25cd91c45 100644 --- a/src/gnome-shell-plugin.c +++ b/src/gnome-shell-plugin.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -38,6 +39,7 @@ static gboolean do_init (const char *params); static gboolean reload (const char *params); +static gboolean xevent_filter (XEvent *xev); /* * Create the plugin struct; function pointers initialized in @@ -72,6 +74,9 @@ g_module_check_init (GModule *module) /* The reload handler */ plugin->reload = reload; + /* Event handling */ + plugin->xevent_filter = xevent_filter; + return NULL; } @@ -159,6 +164,12 @@ reload (const char *params) return FALSE; } +static gboolean +xevent_filter (XEvent *xev) +{ + return clutter_x11_handle_event (xev) != CLUTTER_X11_FILTER_CONTINUE; +} + /* * GModule unload function -- do any cleanup required. */