[Xfce4-commits] <xfce4-panel:devel> Fix problems with plugin calls in the init stage.

Nick Schermer nick at xfce.org
Tue Aug 11 20:35:05 CEST 2009


Updating branch refs/heads/devel
         to 916d0660c44faea553566056201195f88373e6d1 (commit)
       from b591bb2a19ef062401b79afbe8afbbe3c4c41abb (commit)

commit 916d0660c44faea553566056201195f88373e6d1
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Jun 19 23:04:30 2009 +0200

    Fix problems with plugin calls in the init stage.
    
    Provider signals don't work when the plugin is not connected yet, so
    prevent this by adding checks to the plugin functions that do not work
    properly during init, but only in or after the construct stage.
    
    Move show_configure in the plugins to the construct function.

 libxfce4panel/xfce-panel-plugin.c |  100 +++++++++++++++++++++++++------------
 plugins/actions/actions.c         |    6 +-
 plugins/launcher/launcher.c       |    6 +-
 plugins/pager/pager.c             |    6 +-
 plugins/separator/separator.c     |    6 +-
 plugins/systray/systray.c         |    6 +-
 plugins/tasklist/tasklist.c       |    6 +-
 plugins/windowmenu/windowmenu.c   |    6 +-
 8 files changed, 89 insertions(+), 53 deletions(-)

diff --git a/libxfce4panel/xfce-panel-plugin.c b/libxfce4panel/xfce-panel-plugin.c
index 4213d4b..317a28f 100644
--- a/libxfce4panel/xfce-panel-plugin.c
+++ b/libxfce4panel/xfce-panel-plugin.c
@@ -30,7 +30,9 @@
 #include <libxfce4panel/libxfce4panel-marshal.h>
 #include <libxfce4panel/xfce-panel-plugin-provider.h>
 
-
+#define XFCE_PANEL_PLUGIN_CONSTRUCTED(plugin) \
+  PANEL_HAS_FLAG (XFCE_PANEL_PLUGIN (plugin)->priv->flags, \
+                  PLUGIN_FLAG_CONSTRUCTED)
 #define XFCE_PANEL_PLUGIN_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
                                             XFCE_TYPE_PANEL_PLUGIN, \
                                             XfcePanelPluginPrivate))
@@ -624,22 +626,30 @@ xfce_panel_plugin_finalize (GObject *object)
 static void
 xfce_panel_plugin_realize (GtkWidget *widget)
 {
-  XfcePanelPluginClass *klass = XFCE_PANEL_PLUGIN_GET_CLASS (widget);
+  XfcePanelPluginClass *klass = NULL;
   XfcePanelPlugin      *plugin = XFCE_PANEL_PLUGIN (widget);
 
-  /* allow gtk to realize the plugin */
-  (*GTK_WIDGET_CLASS (xfce_panel_plugin_parent_class)->realize) (widget);
-
-  /* check if there is a construct function attached to this plugin */
-  if (klass->construct != NULL
-      && !PANEL_HAS_FLAG (plugin->priv->flags, PLUGIN_FLAG_CONSTRUCTED))
+  if (!PANEL_HAS_FLAG (plugin->priv->flags, PLUGIN_FLAG_CONSTRUCTED))
     {
-      /* run the construct function */
-      (*klass->construct) (XFCE_PANEL_PLUGIN (widget));
-
-      /* don't run the construct function again on another realize */
+      /* we use this flag to check plugin developers with gobject
+       * plugins, that they do not use plugin functions in the init
+       * stage. the properties are not set at that point an the
+       * panel is not aware of the signals and stuff */
       PANEL_SET_FLAG (plugin->priv->flags, PLUGIN_FLAG_CONSTRUCTED);
+
+      /* wether this is an object plugin */
+      klass = XFCE_PANEL_PLUGIN_GET_CLASS (widget);
+      if (klass->construct == NULL)
+        klass = NULL;
     }
+
+  /* let gtk to realize the plugin */
+  (*GTK_WIDGET_CLASS (xfce_panel_plugin_parent_class)->realize) (widget);
+
+  /* check if there is a construct function attached to this plugin if
+   * so, run it */
+  if (klass != NULL)
+    (*klass->construct) (XFCE_PANEL_PLUGIN (widget));
 }
 
 
@@ -732,6 +742,7 @@ xfce_panel_plugin_menu_add_items (XfcePanelPlugin *plugin)
 {
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN_PROVIDER (plugin));
+  panel_return_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin));
 
   /* open items dialog */
   xfce_panel_plugin_provider_emit_signal (XFCE_PANEL_PLUGIN_PROVIDER (plugin),
@@ -745,6 +756,7 @@ xfce_panel_plugin_menu_panel_preferences (XfcePanelPlugin *plugin)
 {
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN_PROVIDER (plugin));
+  panel_return_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin));
 
   /* open preferences dialog */
   xfce_panel_plugin_provider_emit_signal (XFCE_PANEL_PLUGIN_PROVIDER (plugin),
@@ -758,6 +770,7 @@ xfce_panel_plugin_menu_panel_quit (XfcePanelPlugin *plugin)
 {
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN_PROVIDER (plugin));
+  panel_return_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin));
 
   /* quit the panel/session */
   xfce_panel_plugin_provider_emit_signal (XFCE_PANEL_PLUGIN_PROVIDER (plugin),
@@ -771,6 +784,7 @@ xfce_panel_plugin_menu_panel_restart (XfcePanelPlugin *plugin)
 {
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN_PROVIDER (plugin));
+  panel_return_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin));
 
   /* restart the panel */
   xfce_panel_plugin_provider_emit_signal (XFCE_PANEL_PLUGIN_PROVIDER (plugin),
@@ -784,6 +798,7 @@ xfce_panel_plugin_menu_panel_about (XfcePanelPlugin *plugin)
 {
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN_PROVIDER (plugin));
+  panel_return_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin));
 
   /* open the about dialog of the panel */
   xfce_panel_plugin_provider_emit_signal (XFCE_PANEL_PLUGIN_PROVIDER (plugin),
@@ -948,24 +963,24 @@ static void
 xfce_panel_plugin_unregister_menu (GtkMenu         *menu,
                                    XfcePanelPlugin *plugin)
 {
-    panel_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
-    panel_return_if_fail (plugin->priv->panel_lock > 0);
-    panel_return_if_fail (GTK_IS_MENU (menu));
-
-    if (G_LIKELY (plugin->priv->panel_lock > 0))
-      {
-        /* disconnect this signal */
-        g_signal_handlers_disconnect_by_func (G_OBJECT (menu),
-            G_CALLBACK (xfce_panel_plugin_unregister_menu), plugin);
-
-        /* decrease the counter */
-        plugin->priv->panel_lock--;
-
-        /* emit signal to unlock the panel */
-        if (plugin->priv->panel_lock == 0)
-          xfce_panel_plugin_provider_emit_signal (XFCE_PANEL_PLUGIN_PROVIDER (plugin),
-                                                  PROVIDER_SIGNAL_UNLOCK_PANEL);
-      }
+  panel_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
+  panel_return_if_fail (plugin->priv->panel_lock > 0);
+  panel_return_if_fail (GTK_IS_MENU (menu));
+
+  if (G_LIKELY (plugin->priv->panel_lock > 0))
+    {
+      /* disconnect this signal */
+      g_signal_handlers_disconnect_by_func (G_OBJECT (menu),
+          G_CALLBACK (xfce_panel_plugin_unregister_menu), plugin);
+
+      /* decrease the counter */
+      plugin->priv->panel_lock--;
+
+      /* emit signal to unlock the panel */
+      if (plugin->priv->panel_lock == 0)
+        xfce_panel_plugin_provider_emit_signal (XFCE_PANEL_PLUGIN_PROVIDER (plugin),
+                                                PROVIDER_SIGNAL_UNLOCK_PANEL);
+    }
 }
 
 
@@ -1139,6 +1154,7 @@ PANEL_SYMBOL_EXPORT const gchar *
 xfce_panel_plugin_get_name (XfcePanelPlugin *plugin)
 {
   g_return_val_if_fail (XFCE_IS_PANEL_PLUGIN (plugin), NULL);
+  g_return_val_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin), NULL);
 
   return plugin->priv->name;
 }
@@ -1155,6 +1171,7 @@ PANEL_SYMBOL_EXPORT const gchar *
 xfce_panel_plugin_get_display_name (XfcePanelPlugin *plugin)
 {
   g_return_val_if_fail (XFCE_IS_PANEL_PLUGIN (plugin), NULL);
+  g_return_val_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin), NULL);
 
   if (G_LIKELY (plugin->priv->display_name))
     return plugin->priv->display_name;
@@ -1168,6 +1185,7 @@ PANEL_SYMBOL_EXPORT const gchar *
 xfce_panel_plugin_get_comment (XfcePanelPlugin *plugin)
 {
   g_return_val_if_fail (XFCE_IS_PANEL_PLUGIN (plugin), NULL);
+  g_return_val_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin), NULL);
 
   return plugin->priv->comment;
 }
@@ -1186,6 +1204,7 @@ gint
 xfce_panel_plugin_get_unique_id (XfcePanelPlugin *plugin)
 {
   g_return_val_if_fail (XFCE_IS_PANEL_PLUGIN (plugin), -1);
+  g_return_val_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin), -1);
 
   return plugin->priv->unique_id;
 }
@@ -1204,6 +1223,7 @@ PANEL_SYMBOL_EXPORT const gchar *
 xfce_panel_plugin_get_property_base (XfcePanelPlugin *plugin)
 {
   g_return_val_if_fail (XFCE_IS_PANEL_PLUGIN (plugin), NULL);
+  g_return_val_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin), NULL);
 
   /* create the propert if needed */
   if (plugin->priv->property_base == NULL)
@@ -1228,6 +1248,7 @@ PANEL_SYMBOL_EXPORT const gchar * const *
 xfce_panel_plugin_get_arguments (XfcePanelPlugin *plugin)
 {
   g_return_val_if_fail (XFCE_IS_PANEL_PLUGIN (plugin), NULL);
+  g_return_val_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin), NULL);
 
   return (const gchar * const *) plugin->priv->arguments;
 }
@@ -1244,6 +1265,7 @@ PANEL_SYMBOL_EXPORT gint
 xfce_panel_plugin_get_size (XfcePanelPlugin *plugin)
 {
   g_return_val_if_fail (XFCE_IS_PANEL_PLUGIN (plugin), -1);
+  g_return_val_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin), -1);
 
   /* always return a 'positive' size that makes sence */
   return MAX (16, plugin->priv->size);
@@ -1262,6 +1284,7 @@ PANEL_SYMBOL_EXPORT gboolean
 xfce_panel_plugin_get_expand (XfcePanelPlugin *plugin)
 {
   g_return_val_if_fail (XFCE_IS_PANEL_PLUGIN (plugin), FALSE);
+  g_return_val_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin), FALSE);
 
   return plugin->priv->expand;
 }
@@ -1277,6 +1300,7 @@ xfce_panel_plugin_set_expand (XfcePanelPlugin *plugin,
                               gboolean         expand)
 {
   g_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
+  g_return_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin));
 
   /* normalize the value */
   expand = !!expand;
@@ -1309,6 +1333,7 @@ PANEL_SYMBOL_EXPORT GtkOrientation
 xfce_panel_plugin_get_orientation (XfcePanelPlugin *plugin)
 {
   g_return_val_if_fail (XFCE_IS_PANEL_PLUGIN (plugin), GTK_ORIENTATION_HORIZONTAL);
+  g_return_val_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin), GTK_ORIENTATION_HORIZONTAL);
 
   return plugin->priv->orientation;
 }
@@ -1325,6 +1350,7 @@ PANEL_SYMBOL_EXPORT XfceScreenPosition
 xfce_panel_plugin_get_screen_position (XfcePanelPlugin *plugin)
 {
   g_return_val_if_fail (XFCE_IS_PANEL_PLUGIN (plugin), XFCE_SCREEN_POSITION_NONE);
+  g_return_val_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin), XFCE_SCREEN_POSITION_NONE);
 
   return plugin->priv->screen_position;
 }
@@ -1365,7 +1391,8 @@ xfce_panel_plugin_add_action_widget (XfcePanelPlugin *plugin,
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
   /* connect button-press-event signal */
-  g_signal_connect_swapped (G_OBJECT (widget), "button-press-event", G_CALLBACK (xfce_panel_plugin_button_press_event), plugin);
+  g_signal_connect_swapped (G_OBJECT (widget), "button-press-event",
+      G_CALLBACK (xfce_panel_plugin_button_press_event), plugin);
 }
 
 
@@ -1404,6 +1431,7 @@ xfce_panel_plugin_menu_show_configure (XfcePanelPlugin *plugin)
   GtkWidget *item;
 
   g_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
+  g_return_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin));
 
   /* set the flag */
   PANEL_SET_FLAG (plugin->priv->flags, PLUGIN_FLAG_SHOW_CONFIGURE);
@@ -1438,6 +1466,7 @@ xfce_panel_plugin_menu_show_about (XfcePanelPlugin *plugin)
   GtkWidget *item;
 
   g_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
+  g_return_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin));
 
   /* set the flag */
   PANEL_SET_FLAG (plugin->priv->flags, PLUGIN_FLAG_SHOW_ABOUT);
@@ -1504,6 +1533,7 @@ xfce_panel_plugin_register_menu (XfcePanelPlugin *plugin,
 {
   g_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
   g_return_if_fail (GTK_IS_MENU (menu));
+  g_return_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin));
 
   /* increase the counter */
   plugin->priv->panel_lock++;
@@ -1536,7 +1566,8 @@ xfce_panel_plugin_arrow_type (XfcePanelPlugin *plugin)
   GdkRectangle        monitor;
   gint                x, y;
 
-  g_return_val_if_fail (XFCE_IS_PANEL_PLUGIN (plugin), GTK_ARROW_UP);
+  g_return_val_if_fail (XFCE_IS_PANEL_PLUGIN (plugin), GTK_ARROW_NONE);
+  g_return_val_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin), GTK_ARROW_NONE);
 
   /* get the plugin screen position */
   screen_position = xfce_panel_plugin_get_screen_position (plugin);
@@ -1595,6 +1626,7 @@ xfce_panel_plugin_position_widget (XfcePanelPlugin *plugin,
   g_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
   g_return_if_fail (GTK_IS_WIDGET (menu_widget));
   g_return_if_fail (attach_widget == NULL || GTK_IS_WIDGET (attach_widget));
+  g_return_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin));
 
   /* if the attach widget is null, use the panel plugin */
   if (attach_widget == NULL)
@@ -1682,6 +1714,7 @@ xfce_panel_plugin_position_menu (GtkMenu  *menu,
 
   g_return_if_fail (XFCE_IS_PANEL_PLUGIN (panel_plugin));
   g_return_if_fail (GTK_IS_MENU (menu));
+  g_return_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (panel_plugin));
 
   /* get the attach widget */
   attach_widget = gtk_menu_get_attach_widget (menu);
@@ -1705,6 +1738,7 @@ xfce_panel_plugin_focus_widget (XfcePanelPlugin *plugin,
 {
   g_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
   g_return_if_fail (GTK_IS_WIDGET (widget));
+  g_return_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin));
 
   /* focus the panel window */
   xfce_panel_plugin_provider_emit_signal (XFCE_PANEL_PLUGIN_PROVIDER (plugin),
@@ -1721,6 +1755,7 @@ xfce_panel_plugin_block_autohide (XfcePanelPlugin *plugin,
                                   gboolean         blocked)
 {
   g_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
+  g_return_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin));
 
   /* leave when requesting the same block state */
   if (PANEL_HAS_FLAG (plugin->priv->flags, PLUGIN_FLAG_BLOCK_AUTOHIDE) == blocked)
@@ -1778,6 +1813,7 @@ xfce_panel_plugin_lookup_rc_file (XfcePanelPlugin *plugin)
   gchar *filename, *path;
 
   g_return_val_if_fail (XFCE_IS_PANEL_PLUGIN (plugin), NULL);
+  g_return_val_if_fail (XFCE_PANEL_PLUGIN_CONSTRUCTED (plugin), NULL);
 
   /* get the relative filename */
   filename = xfce_panel_plugin_relative_filename (plugin);
diff --git a/plugins/actions/actions.c b/plugins/actions/actions.c
index 56740bb..fd215be 100644
--- a/plugins/actions/actions.c
+++ b/plugins/actions/actions.c
@@ -179,9 +179,6 @@ actions_plugin_init (ActionsPlugin *plugin)
   plugin->first_action = ACTION_LOG_OUT_DIALOG;
   plugin->second_action = ACTION_DISABLED;
 
-  /* show the properties dialog */
-  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
-
   plugin->box = xfce_hvbox_new (GTK_ORIENTATION_HORIZONTAL, TRUE, 0);
   gtk_container_add (GTK_CONTAINER (plugin), plugin->box);
 
@@ -301,6 +298,9 @@ actions_plugin_construct (XfcePanelPlugin *panel_plugin)
     { NULL, G_TYPE_NONE }
   };
 
+  /* show the properties dialog */
+  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
+
   /* bind all properties */
   panel_properties_bind (NULL, G_OBJECT (plugin),
                          xfce_panel_plugin_get_property_base (panel_plugin),
diff --git a/plugins/launcher/launcher.c b/plugins/launcher/launcher.c
index b100a5f..6579289 100644
--- a/plugins/launcher/launcher.c
+++ b/plugins/launcher/launcher.c
@@ -246,9 +246,6 @@ launcher_plugin_init (LauncherPlugin *plugin)
   plugin->menu_timeout_id = 0;
   plugin->menu_icon_size = DEFAULT_MENU_ICON_SIZE;
 
-  /* show the configure menu item */
-  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
-
   /* monitor the default icon theme for changes */
   icon_theme = gtk_icon_theme_get_default ();
   if (G_LIKELY (icon_theme != NULL))
@@ -545,6 +542,9 @@ launcher_plugin_construct (XfcePanelPlugin *panel_plugin)
     { NULL, G_TYPE_NONE }
   };
 
+  /* show the configure menu item */
+  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
+
   /* bind all properties */
   panel_properties_bind (NULL, G_OBJECT (plugin),
                          xfce_panel_plugin_get_property_base (panel_plugin),
diff --git a/plugins/pager/pager.c b/plugins/pager/pager.c
index 6c3cdae..2b37fc3 100644
--- a/plugins/pager/pager.c
+++ b/plugins/pager/pager.c
@@ -148,9 +148,6 @@ pager_plugin_init (PagerPlugin *plugin)
   plugin->show_names = FALSE;
   plugin->rows = 1;
   plugin->wnck_pager = NULL;
-
-  /* show the properties dialog */
-  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
 }
 
 
@@ -310,6 +307,9 @@ pager_plugin_construct (XfcePanelPlugin *panel_plugin)
     { NULL, G_TYPE_NONE }
   };
 
+  /* show the properties dialog */
+  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
+
   /* bind all properties */
   panel_properties_bind (NULL, G_OBJECT (plugin),
                          xfce_panel_plugin_get_property_base (panel_plugin),
diff --git a/plugins/separator/separator.c b/plugins/separator/separator.c
index b445dfb..df569eb 100644
--- a/plugins/separator/separator.c
+++ b/plugins/separator/separator.c
@@ -137,9 +137,6 @@ separator_plugin_init (SeparatorPlugin *plugin)
 {
   /* initialize */
   plugin->style = SEPARATOR_PLUGIN_STYLE_SEPARATOR;
-
-  /* show the properties dialog */
-  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
 }
 
 
@@ -274,6 +271,9 @@ separator_plugin_construct (XfcePanelPlugin *panel_plugin)
     { NULL, G_TYPE_NONE }
   };
 
+  /* show the properties dialog */
+  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
+
   /* connect all properties */
   panel_properties_bind (NULL, G_OBJECT (plugin),
                          xfce_panel_plugin_get_property_base (panel_plugin),
diff --git a/plugins/systray/systray.c b/plugins/systray/systray.c
index a86f3a4..00a2cf1 100644
--- a/plugins/systray/systray.c
+++ b/plugins/systray/systray.c
@@ -155,9 +155,6 @@ systray_plugin_init (SystrayPlugin *plugin)
   plugin->manager = NULL;
   plugin->show_frame = FALSE;
 
-  /* show configure */
-  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
-
   /* plugin widgets */
   plugin->frame = gtk_frame_new (NULL);
   gtk_container_add (GTK_CONTAINER (plugin), plugin->frame);
@@ -298,6 +295,9 @@ systray_plugin_construct (XfcePanelPlugin *panel_plugin)
     { NULL, G_TYPE_NONE }
   };
 
+  /* show configure */
+  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
+
   /* bind all properties */
   panel_properties_bind (NULL, G_OBJECT (plugin),
                          xfce_panel_plugin_get_property_base (panel_plugin),
diff --git a/plugins/tasklist/tasklist.c b/plugins/tasklist/tasklist.c
index 96b459c..f4056f4 100644
--- a/plugins/tasklist/tasklist.c
+++ b/plugins/tasklist/tasklist.c
@@ -90,9 +90,6 @@ tasklist_plugin_init (TasklistPlugin *plugin)
 {
   GtkWidget *box;
 
-  /* show configure */
-  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
-
   /* create widgets */
   box = xfce_hvbox_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 0);
   gtk_container_add (GTK_CONTAINER (plugin), box);
@@ -132,6 +129,9 @@ tasklist_plugin_construct (XfcePanelPlugin *panel_plugin)
     { NULL, G_TYPE_NONE }
   };
 
+  /* show configure */
+  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
+
   /* expand the plugin */
   xfce_panel_plugin_set_expand (panel_plugin, TRUE);
 
diff --git a/plugins/windowmenu/windowmenu.c b/plugins/windowmenu/windowmenu.c
index 650680e..d9446d3 100644
--- a/plugins/windowmenu/windowmenu.c
+++ b/plugins/windowmenu/windowmenu.c
@@ -201,9 +201,6 @@ window_menu_plugin_init (WindowMenuPlugin *plugin)
   plugin->all_workspaces = TRUE;
   plugin->urgent_windows = 0;
 
-  /* show configure */
-  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
-
   /* create the widgets */
   plugin->button = xfce_arrow_button_new (GTK_ARROW_NONE);
   xfce_panel_plugin_add_action_widget (XFCE_PANEL_PLUGIN (plugin), plugin->button);
@@ -387,6 +384,9 @@ window_menu_plugin_construct (XfcePanelPlugin *panel_plugin)
     { NULL, G_TYPE_NONE }
   };
 
+  /* show configure */
+  xfce_panel_plugin_menu_show_configure (XFCE_PANEL_PLUGIN (plugin));
+
   /* show the icon */
   gtk_widget_show (plugin->icon);
 



More information about the Xfce4-commits mailing list