Updating branch refs/heads/master
         to bc18274854ae80e41615108db31eb58dc6b69c39 (commit)
       from e9ed7f813e3b620676b656e617e32a9627ae247b (commit)

commit bc18274854ae80e41615108db31eb58dc6b69c39
Author: Nick Schermer <n...@xfce.org>
Date:   Fri Nov 26 20:36:44 2010 +0100

    Don't destroy the menu under the users' cursor.
    
    Add a signal to destroy the menu when the user closed it
    if the menu is popped up.

 plugins/applicationsmenu/applicationsmenu.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/plugins/applicationsmenu/applicationsmenu.c 
b/plugins/applicationsmenu/applicationsmenu.c
index 3f8827d..79ac910 100644
--- a/plugins/applicationsmenu/applicationsmenu.c
+++ b/plugins/applicationsmenu/applicationsmenu.c
@@ -861,9 +861,14 @@ applications_menu_plugin_menu_reload 
(ApplicationsMenuPlugin *plugin)
       panel_debug (PANEL_DEBUG_DOMAIN_APPLICATIONMENU,
                    "destroy menu for reload");
 
-      /* give garcon time to handle all the events */
-      exo_gtk_object_destroy_later (GTK_OBJECT (plugin->menu));
-      plugin->menu = NULL;
+      /* if the menu is opened, do not destroy it under the users'
+       * cursor, else destroy the menu in an idle, to give garcon
+       * time to finalize the events that triggered the reload */
+      if (GTK_WIDGET_VISIBLE (plugin->menu))
+        g_signal_connect (G_OBJECT (plugin->menu), "selection-done",
+            G_CALLBACK (exo_gtk_object_destroy_later), NULL);
+      else
+        exo_gtk_object_destroy_later (GTK_OBJECT (plugin->menu));
     }
 }
 
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to