[Xfce4-commits] <xfdesktop:master> only register menu with panel if popup succeeded (bug 5792)

Brian J. Tarricone noreply at xfce.org
Mon Oct 19 09:24:02 CEST 2009


Updating branch refs/heads/master
         to b3de137420a36ff40e9bfdba93eb60cd28ae9c3d (commit)
       from 9727fa646f0a5c7f476e863bf63c6542b5f603b6 (commit)

commit b3de137420a36ff40e9bfdba93eb60cd28ae9c3d
Author: Brian J. Tarricone <brian at tarricone.org>
Date:   Mon Oct 19 00:23:15 2009 -0700

    only register menu with panel if popup succeeded (bug 5792)

 panel-plugin/desktop-menu-plugin.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/panel-plugin/desktop-menu-plugin.c b/panel-plugin/desktop-menu-plugin.c
index d2ece3e..d5670d2 100644
--- a/panel-plugin/desktop-menu-plugin.c
+++ b/panel-plugin/desktop-menu-plugin.c
@@ -376,10 +376,11 @@ menu_activate(DMPlugin *dmp, gboolean at_pointer)
                          G_CALLBACK(menu_deactivated), dmp);
         if (!at_pointer)
           gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE);
-        xfce_panel_plugin_register_menu (dmp->plugin, GTK_MENU(menu));
         gtk_menu_popup(GTK_MENU(menu), NULL, NULL,
                        (GtkMenuPositionFunc)(at_pointer ? NULL : dmp_position_menu),
                        dmp, 1, gtk_get_current_event_time());
+        if(gtk_grab_get_current() == menu)
+            xfce_panel_plugin_register_menu(dmp->plugin, GTK_MENU(menu));
     } else
         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), FALSE);
 }



More information about the Xfce4-commits mailing list