From 574c0c32875916d94433f49a129ac79b12d0422c Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 5 Apr 2012 01:25:46 -0400 Subject: [PATCH] meta-plugin: Remove "disabled" feature It's just code cruft that nobody's using https://bugzilla.gnome.org/show_bug.cgi?id=676855 --- src/compositor/meta-plugin-manager.c | 129 ++++++++++++--------------- src/compositor/meta-plugin.c | 24 ----- src/meta/meta-plugin.h | 1 - 3 files changed, 59 insertions(+), 95 deletions(-) diff --git a/src/compositor/meta-plugin-manager.c b/src/compositor/meta-plugin-manager.c index f23e17f83..8f03805f1 100644 --- a/src/compositor/meta-plugin-manager.c +++ b/src/compositor/meta-plugin-manager.c @@ -205,8 +205,7 @@ meta_plugin_manager_kill_window_effects (MetaPluginManager *plugin_mgr, MetaPlugin *plugin = l->data; MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin); - if (!meta_plugin_disabled (plugin) - && klass->kill_window_effects) + if (klass->kill_window_effects) klass->kill_window_effects (plugin, actor); l = l->next; @@ -223,7 +222,7 @@ meta_plugin_manager_kill_switch_workspace (MetaPluginManager *plugin_mgr) MetaPlugin *plugin = l->data; MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin); - if (!meta_plugin_disabled (plugin) && klass->kill_switch_workspace) + if (klass->kill_switch_workspace) klass->kill_switch_workspace (plugin); l = l->next; @@ -256,45 +255,40 @@ meta_plugin_manager_event_simple (MetaPluginManager *plugin_mgr, MetaPlugin *plugin = l->data; MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin); - if (!meta_plugin_disabled (plugin)) + switch (event) { - switch (event) + case META_PLUGIN_MINIMIZE: + if (klass->minimize) { - case META_PLUGIN_MINIMIZE: - if (klass->minimize) - { - retval = TRUE; - meta_plugin_manager_kill_window_effects ( - plugin_mgr, - actor); + retval = TRUE; + meta_plugin_manager_kill_window_effects (plugin_mgr, + actor); - _meta_plugin_effect_started (plugin); - klass->minimize (plugin, actor); - } - break; - case META_PLUGIN_MAP: - if (klass->map) - { - retval = TRUE; - meta_plugin_manager_kill_window_effects ( - plugin_mgr, - actor); - - _meta_plugin_effect_started (plugin); - klass->map (plugin, actor); - } - break; - case META_PLUGIN_DESTROY: - if (klass->destroy) - { - retval = TRUE; - _meta_plugin_effect_started (plugin); - klass->destroy (plugin, actor); - } - break; - default: - g_warning ("Incorrect handler called for event %lu", event); + _meta_plugin_effect_started (plugin); + klass->minimize (plugin, actor); } + break; + case META_PLUGIN_MAP: + if (klass->map) + { + retval = TRUE; + meta_plugin_manager_kill_window_effects (plugin_mgr, + actor); + + _meta_plugin_effect_started (plugin); + klass->map (plugin, actor); + } + break; + case META_PLUGIN_DESTROY: + if (klass->destroy) + { + retval = TRUE; + _meta_plugin_effect_started (plugin); + klass->destroy (plugin, actor); + } + break; + default: + g_warning ("Incorrect handler called for event %lu", event); } l = l->next; @@ -333,41 +327,36 @@ meta_plugin_manager_event_maximize (MetaPluginManager *plugin_mgr, MetaPlugin *plugin = l->data; MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin); - if (!meta_plugin_disabled (plugin)) + switch (event) { - switch (event) + case META_PLUGIN_MAXIMIZE: + if (klass->maximize) { - case META_PLUGIN_MAXIMIZE: - if (klass->maximize) - { - retval = TRUE; - meta_plugin_manager_kill_window_effects ( - plugin_mgr, - actor); + retval = TRUE; + meta_plugin_manager_kill_window_effects (plugin_mgr, + actor); - _meta_plugin_effect_started (plugin); - klass->maximize (plugin, actor, - target_x, target_y, - target_width, target_height); - } - break; - case META_PLUGIN_UNMAXIMIZE: - if (klass->unmaximize) - { - retval = TRUE; - meta_plugin_manager_kill_window_effects ( - plugin_mgr, - actor); - - _meta_plugin_effect_started (plugin); - klass->unmaximize (plugin, actor, - target_x, target_y, - target_width, target_height); - } - break; - default: - g_warning ("Incorrect handler called for event %lu", event); + _meta_plugin_effect_started (plugin); + klass->maximize (plugin, actor, + target_x, target_y, + target_width, target_height); } + break; + case META_PLUGIN_UNMAXIMIZE: + if (klass->unmaximize) + { + retval = TRUE; + meta_plugin_manager_kill_window_effects (plugin_mgr, + actor); + + _meta_plugin_effect_started (plugin); + klass->unmaximize (plugin, actor, + target_x, target_y, + target_width, target_height); + } + break; + default: + g_warning ("Incorrect handler called for event %lu", event); } l = l->next; @@ -402,7 +391,7 @@ meta_plugin_manager_switch_workspace (MetaPluginManager *plugin_mgr, MetaPlugin *plugin = l->data; MetaPluginClass *klass = META_PLUGIN_GET_CLASS (plugin); - if (!meta_plugin_disabled (plugin) && klass->switch_workspace) + if (klass->switch_workspace) { retval = TRUE; meta_plugin_manager_kill_switch_workspace (plugin_mgr); diff --git a/src/compositor/meta-plugin.c b/src/compositor/meta-plugin.c index 840e3ae1d..fa4e6d6ba 100644 --- a/src/compositor/meta-plugin.c +++ b/src/compositor/meta-plugin.c @@ -44,7 +44,6 @@ enum { PROP_0, PROP_SCREEN, - PROP_DISABLED, PROP_DEBUG_MODE, }; @@ -54,7 +53,6 @@ struct _MetaPluginPrivate gint running; - gboolean disabled : 1; gboolean debug : 1; }; @@ -71,9 +69,6 @@ meta_plugin_set_property (GObject *object, case PROP_SCREEN: priv->screen = g_value_get_object (value); break; - case PROP_DISABLED: - priv->disabled = g_value_get_boolean (value); - break; case PROP_DEBUG_MODE: priv->debug = g_value_get_boolean (value); break; @@ -96,9 +91,6 @@ meta_plugin_get_property (GObject *object, case PROP_SCREEN: g_value_set_object (value, priv->screen); break; - case PROP_DISABLED: - g_value_set_boolean (value, priv->disabled); - break; case PROP_DEBUG_MODE: g_value_set_boolean (value, priv->debug); break; @@ -125,14 +117,6 @@ meta_plugin_class_init (MetaPluginClass *klass) META_TYPE_SCREEN, G_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, - PROP_DISABLED, - g_param_spec_boolean ("disabled", - "Plugin disabled", - "Plugin disabled", - FALSE, - G_PARAM_READWRITE)); - g_object_class_install_property (gobject_class, PROP_DEBUG_MODE, g_param_spec_boolean ("debug-mode", @@ -152,14 +136,6 @@ meta_plugin_init (MetaPlugin *self) self->priv = priv = META_PLUGIN_GET_PRIVATE (self); } -gboolean -meta_plugin_disabled (MetaPlugin *plugin) -{ - MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv; - - return priv->disabled; -} - gboolean meta_plugin_running (MetaPlugin *plugin) { diff --git a/src/meta/meta-plugin.h b/src/meta/meta-plugin.h index 8dae83ad5..d85f71abf 100644 --- a/src/meta/meta-plugin.h +++ b/src/meta/meta-plugin.h @@ -123,7 +123,6 @@ struct _MetaPluginInfo GType meta_plugin_get_type (void); -gboolean meta_plugin_disabled (MetaPlugin *plugin); gboolean meta_plugin_running (MetaPlugin *plugin); gboolean meta_plugin_debug_mode (MetaPlugin *plugin);