[Xfce4-commits] <xfce4-panel:devel> Also watch widget::destroy in xfce_panel_plugin_register_menu().

Nick Schermer noreply at xfce.org
Tue Feb 2 20:44:03 CET 2010


Updating branch refs/heads/devel
         to 3ff9bdee67c63a335cb7c0067c47911cede6b421 (commit)
       from 0cdd86a4e1db680e766e7b6e1a387a4553e8b5c4 (commit)

commit 3ff9bdee67c63a335cb7c0067c47911cede6b421
Author: Nick Schermer <nick at xfce.org>
Date:   Tue Feb 2 20:31:55 2010 +0100

    Also watch widget::destroy in xfce_panel_plugin_register_menu().
    
    This should prevent bugs where menus are destroyed and
    don't emit the deactivate signal, which prevents the panel
    from hiding again.

 libxfce4panel/xfce-panel-plugin.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/libxfce4panel/xfce-panel-plugin.c b/libxfce4panel/xfce-panel-plugin.c
index a27da25..a9c509e 100644
--- a/libxfce4panel/xfce-panel-plugin.c
+++ b/libxfce4panel/xfce-panel-plugin.c
@@ -1086,12 +1086,12 @@ xfce_panel_plugin_unregister_menu (GtkMenu         *menu,
   panel_return_if_fail (plugin->priv->panel_lock > 0);
   panel_return_if_fail (GTK_IS_MENU (menu));
 
+  /* disconnect this signal */
+  g_signal_handlers_disconnect_by_func (G_OBJECT (menu),
+      G_CALLBACK (xfce_panel_plugin_unregister_menu), plugin);
+
   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--;
 
@@ -1833,6 +1833,8 @@ xfce_panel_plugin_register_menu (XfcePanelPlugin *plugin,
   /* connect signal to menu to decrease counter */
   g_signal_connect (G_OBJECT (menu), "deactivate",
       G_CALLBACK (xfce_panel_plugin_unregister_menu), plugin);
+  g_signal_connect (G_OBJECT (menu), "destroy",
+      G_CALLBACK (xfce_panel_plugin_unregister_menu), plugin);
 
   /* tell panel it needs to lock */
   if (plugin->priv->panel_lock == 1)



More information about the Xfce4-commits mailing list