diff --git a/src/compositor/mutter/mutter-plugin-manager.c b/src/compositor/mutter/mutter-plugin-manager.c index c17eae2cf..25f75df42 100644 --- a/src/compositor/mutter/mutter-plugin-manager.c +++ b/src/compositor/mutter/mutter-plugin-manager.c @@ -399,6 +399,7 @@ mutter_plugin_manager_event_simple (MutterPluginManager *plugin_mgr, actor, ALL_BUT_SWITCH); + _mutter_plugin_effect_started (plugin); klass->minimize (plugin, actor); } break; @@ -410,12 +411,14 @@ mutter_plugin_manager_event_simple (MutterPluginManager *plugin_mgr, actor, ALL_BUT_SWITCH); + _mutter_plugin_effect_started (plugin); klass->map (plugin, actor); } break; case MUTTER_PLUGIN_DESTROY: if (klass->destroy) { + _mutter_plugin_effect_started (plugin); klass->destroy (plugin, actor); } break; @@ -471,6 +474,7 @@ mutter_plugin_manager_event_maximize (MutterPluginManager *plugin_mgr, actor, ALL_BUT_SWITCH); + _mutter_plugin_effect_started (plugin); klass->maximize (plugin, actor, target_x, target_y, target_width, target_height); @@ -483,6 +487,8 @@ mutter_plugin_manager_event_maximize (MutterPluginManager *plugin_mgr, plugin_mgr, actor, ALL_BUT_SWITCH); + + _mutter_plugin_effect_started (plugin); klass->unmaximize (plugin, actor, target_x, target_y, target_width, target_height); @@ -534,6 +540,7 @@ mutter_plugin_manager_switch_workspace (MutterPluginManager *plugin_mgr, MUTTER_WINDOW ((*actors)->data), MUTTER_PLUGIN_SWITCH_WORKSPACE); + _mutter_plugin_effect_started (plugin); klass->switch_workspace (plugin, actors, from, to, direction); } } diff --git a/src/compositor/mutter/mutter-plugin.c b/src/compositor/mutter/mutter-plugin.c index 32a6b1fca..365f56c60 100644 --- a/src/compositor/mutter/mutter-plugin.c +++ b/src/compositor/mutter/mutter-plugin.c @@ -218,91 +218,17 @@ mutter_plugin_get_property (GObject *object, } } -static void -mutter_plugin_real_minimize (MutterPlugin *plugin, MutterWindow *actor) -{ - MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv; - - priv->running++; -} - -static void -mutter_plugin_real_maximize (MutterPlugin *plugin, - MutterWindow *actor, - gint x, - gint y, - gint width, - gint height) -{ - MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv; - - priv->running++; -} - - -static void -mutter_plugin_real_unmaximize (MutterPlugin *plugin, - MutterWindow *actor, - gint x, - gint y, - gint width, - gint height) -{ - MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv; - - priv->running++; -} - - -static void -mutter_plugin_real_map (MutterPlugin *plugin, MutterWindow *actor) -{ - MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv; - - priv->running++; -} - - -static void -mutter_plugin_real_destroy (MutterPlugin *plugin, MutterWindow *actor) -{ - MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv; - - priv->running++; -} - - -static void -mutter_plugin_real_switch_workspace (MutterPlugin *plugin, - const GList **actors, - gint from, - gint to, - MetaMotionDirection direction) -{ - MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv; - - priv->running++; -} - static void mutter_plugin_class_init (MutterPluginClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - MutterPluginClass *plugin_class = MUTTER_PLUGIN_CLASS (klass); gobject_class->finalize = mutter_plugin_finalize; gobject_class->dispose = mutter_plugin_dispose; gobject_class->set_property = mutter_plugin_set_property; gobject_class->get_property = mutter_plugin_get_property; - plugin_class->map = mutter_plugin_real_map; - plugin_class->minimize = mutter_plugin_real_minimize; - plugin_class->maximize = mutter_plugin_real_maximize; - plugin_class->unmaximize = mutter_plugin_real_unmaximize; - plugin_class->destroy = mutter_plugin_real_destroy; - plugin_class->switch_workspace = mutter_plugin_real_switch_workspace; - g_object_class_install_property (gobject_class, PROP_SCREEN, g_param_spec_object ("screen", @@ -423,6 +349,21 @@ mutter_plugin_get_window_group (MutterPlugin *plugin) return mutter_get_window_group_for_screen (priv->screen); } +/** + * _mutter_plugin_effect_started: + * @plugin: the plugin + * + * Mark that an effect has started for the plugin. This is called + * internally by MutterPluginManager. + */ +void +_mutter_plugin_effect_started (MutterPlugin *plugin) +{ + MutterPluginPrivate *priv = MUTTER_PLUGIN (plugin)->priv; + + priv->running++; +} + void mutter_plugin_effect_completed (MutterPlugin *plugin, MutterWindow *actor, diff --git a/src/compositor/mutter/plugins/default.c b/src/compositor/mutter/plugins/default.c index 7e4702f95..fd7fc291a 100644 --- a/src/compositor/mutter/plugins/default.c +++ b/src/compositor/mutter/plugins/default.c @@ -361,10 +361,6 @@ switch_workspace (MutterPlugin *plugin, MetaScreen *screen = mutter_plugin_get_screen (plugin); SwitchWorkspaceData *sw_data = g_new (SwitchWorkspaceData, 1); - /* Must chain up first */ - MUTTER_PLUGIN_CLASS (mutter_default_plugin_parent_class)-> - switch_workspace (plugin, actors, from, to, direction); - sw_data->plugin = plugin; sw_data->actors = actors; @@ -494,10 +490,6 @@ minimize (MutterPlugin *plugin, MutterWindow *mc_window) MetaCompWindowType type; ClutterActor *actor = CLUTTER_ACTOR (mc_window); - /* Must chain up first */ - MUTTER_PLUGIN_CLASS (mutter_default_plugin_parent_class)-> - minimize (plugin, mc_window); - type = mutter_window_get_window_type (mc_window); if (type == META_COMP_WINDOW_NORMAL) @@ -570,10 +562,6 @@ maximize (MutterPlugin *plugin, gint anchor_x = 0; gint anchor_y = 0; - /* Must chain up first */ - MUTTER_PLUGIN_CLASS (mutter_default_plugin_parent_class)-> - maximize (plugin, mc_window, end_x, end_y, end_width, end_height); - type = mutter_window_get_window_type (mc_window); if (type == META_COMP_WINDOW_NORMAL) @@ -629,10 +617,6 @@ unmaximize (MutterPlugin *plugin, { MetaCompWindowType type = mutter_window_get_window_type (mc_window); - /* Must chain up first */ - MUTTER_PLUGIN_CLASS (mutter_default_plugin_parent_class)-> - unmaximize (plugin, mc_window, end_x, end_y, end_width, end_height); - if (type == META_COMP_WINDOW_NORMAL) { ActorPrivate *apriv = get_actor_private (mc_window); @@ -675,10 +659,6 @@ map (MutterPlugin *plugin, MutterWindow *mc_window) MetaCompWindowType type; ClutterActor *actor = CLUTTER_ACTOR (mc_window); - /* Must chain up first */ - MUTTER_PLUGIN_CLASS (mutter_default_plugin_parent_class)-> - map (plugin, mc_window); - type = mutter_window_get_window_type (mc_window); if (type == META_COMP_WINDOW_NORMAL) @@ -734,10 +714,6 @@ destroy (MutterPlugin *plugin, MutterWindow *mc_window) MetaCompWindowType type; ClutterActor *actor = CLUTTER_ACTOR (mc_window); - /* Must chain up first */ - MUTTER_PLUGIN_CLASS (mutter_default_plugin_parent_class)-> - destroy (plugin, mc_window); - type = mutter_window_get_window_type (mc_window); if (type == META_COMP_WINDOW_NORMAL) diff --git a/src/include/mutter-plugin.h b/src/include/mutter-plugin.h index a0547f9a5..5f84adb9a 100644 --- a/src/include/mutter-plugin.h +++ b/src/include/mutter-plugin.h @@ -264,4 +264,7 @@ mutter_plugin_get_xdisplay (MutterPlugin *plugin); MetaScreen * mutter_plugin_get_screen (MutterPlugin *plugin); +void +_mutter_plugin_effect_started (MutterPlugin *plugin); + #endif /* MUTTER_PLUGIN_H_ */