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
This commit is contained in:
Owen Taylor 2008-10-31 18:02:52 +00:00
parent 2fd4c9058d
commit dec83013fc

View File

@ -29,6 +29,7 @@
#include <glib/gi18n-lib.h>
#include <clutter/clutter.h>
#include <clutter/x11/clutter-x11.h>
#include <gjs/gjs.h>
#include <gmodule.h>
#include <string.h>
@ -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.
*/