[mutter/wip/wayland-input: 9/9] plugins: Don't assume the plugins will pass events to Clutter



commit 9f55d02adf7e940f72e7a6f4a2b13f6fea446fcc
Author: Neil Roberts <neil linux intel com>
Date:   Wed Mar 14 17:13:59 2012 +0000

    plugins: Don't assume the plugins will pass events to Clutter
    
    The plugin API was previously assuming that any plugin with an xevent
    filter would pass the events on to Clutter. There was a comment saying
    that this should be removed so that the plugin manager itself could
    pass on the events which would help if there are multiple plugins that
    want to filter xevents. The comment also said it wasn't worth changing
    the API because it basically works. However now that there is Wayland
    support in Mutter the change is a bit more worthwhile because the
    plugins would need to be modified to not forward on the events when
    the compositor is under Wayland. This patch does that.

 src/compositor/meta-plugin-manager.c |   27 +++------------------------
 1 files changed, 3 insertions(+), 24 deletions(-)
---
diff --git a/src/compositor/meta-plugin-manager.c b/src/compositor/meta-plugin-manager.c
index 9c3effb..5d65705 100644
--- a/src/compositor/meta-plugin-manager.c
+++ b/src/compositor/meta-plugin-manager.c
@@ -437,31 +437,12 @@ meta_plugin_manager_xevent_filter (MetaPluginManager *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)
     {
       MetaPlugin      *plugin = l->data;
@@ -469,7 +450,6 @@ meta_plugin_manager_xevent_filter (MetaPluginManager *plugin_mgr,
 
       if (klass->xevent_filter)
         {
-          have_plugin_xevent_func = TRUE;
           if (klass->xevent_filter (plugin, xev) == TRUE)
             return TRUE;
         }
@@ -478,9 +458,8 @@ meta_plugin_manager_xevent_filter (MetaPluginManager *plugin_mgr,
     }
 
 #ifndef HAVE_WAYLAND
-  if (!have_plugin_xevent_func)
-    return clutter_x11_handle_event (xev) != CLUTTER_X11_FILTER_CONTINUE;
-#endif
-
+  return clutter_x11_handle_event (xev) != CLUTTER_X11_FILTER_CONTINUE;
+#else
   return FALSE;
+#endif
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]