diff --git a/src/compositor/mutter-plugin-manager.c b/src/compositor/mutter-plugin-manager.c index 98d3f191b..9d8ae744e 100644 --- a/src/compositor/mutter-plugin-manager.c +++ b/src/compositor/mutter-plugin-manager.c @@ -30,6 +30,8 @@ #include +#include + /* * There is only one instace of each module per the process. */ @@ -585,12 +587,31 @@ mutter_plugin_manager_xevent_filter (MutterPluginManager *plugin_mgr, XEvent *xev) { GList *l; + gboolean have_plugin_xevent_func; if (!plugin_mgr) return FALSE; l = plugin_mgr->plugins; + /* We need to make sure that clutter gets certain events, like + * ConfigureNotify on the stage window. If there is a plugin that + * provides an xevent_filter function, then it's the responsibility + * of that plugin to pass events to Clutter. Otherwise, we send the + * event directly to Clutter ourselves. + * + * What happens if there are two plugins with xevent_filter functions + * is undefined; in general, multiple competing plugins are something + * we don't support well or care much about. + * + * FIXME: Really, we should just always handle sending the event to + * clutter if a plugin doesn't report the event as handled by + * returning TRUE, but it doesn't seem worth breaking compatibility + * of the plugin interface right now to achieve this; the way it is + * now works fine in practice. + */ + have_plugin_xevent_func = FALSE; + while (l) { MutterPlugin *plugin = l->data; @@ -598,6 +619,7 @@ mutter_plugin_manager_xevent_filter (MutterPluginManager *plugin_mgr, if (klass->xevent_filter) { + have_plugin_xevent_func = TRUE; if (klass->xevent_filter (plugin, xev) == TRUE) return TRUE; } @@ -605,5 +627,8 @@ mutter_plugin_manager_xevent_filter (MutterPluginManager *plugin_mgr, l = l->next; } + if (!have_plugin_xevent_func) + return clutter_x11_handle_event (xev) != CLUTTER_X11_FILTER_CONTINUE; + return FALSE; }