diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2011-04-14 18:45:12 -0400 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2011-04-14 18:45:12 -0400 |
commit | 9efd2866602c9b33f993f5e8e5954078a196b53b (patch) | |
tree | 93b605b5992209441d1e209f36b6a23859e8c8f6 /libdbusmenu-gtk/menu.c | |
parent | f25ac35c8a5ddba42bd987accbeb209829236dc2 (diff) | |
parent | 2c9d70b972291a0502b3e827f13b120e20565989 (diff) | |
download | libdbusmenu-9efd2866602c9b33f993f5e8e5954078a196b53b.tar.gz libdbusmenu-9efd2866602c9b33f993f5e8e5954078a196b53b.tar.bz2 libdbusmenu-9efd2866602c9b33f993f5e8e5954078a196b53b.zip |
releasing version 0.4.3-0ubuntu1
Diffstat (limited to 'libdbusmenu-gtk/menu.c')
-rw-r--r-- | libdbusmenu-gtk/menu.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libdbusmenu-gtk/menu.c b/libdbusmenu-gtk/menu.c index 0b31069..236a596 100644 --- a/libdbusmenu-gtk/menu.c +++ b/libdbusmenu-gtk/menu.c @@ -329,6 +329,18 @@ remove_child_signals (gpointer data, gpointer user_data) return; } +/* Handler for all of the menu items on a root change to ensure that + the menus are hidden before we start going and deleting things. */ +static void +popdown_all (DbusmenuMenuitem * mi, gpointer user_data) +{ + GtkMenu * menu = dbusmenu_gtkclient_menuitem_get_submenu(DBUSMENU_GTKCLIENT(user_data), mi); + if (menu != NULL) { + gtk_menu_popdown(menu); + } + return; +} + /* When the root menuitem changes we need to resetup things so that we're back in the game. */ static void @@ -344,6 +356,8 @@ root_changed (DbusmenuGtkClient * client, DbusmenuMenuitem * newroot, DbusmenuGt g_signal_handlers_disconnect_by_func(G_OBJECT(priv->root), root_child_moved, menu); g_signal_handlers_disconnect_by_func(G_OBJECT(priv->root), root_child_delete, menu); + dbusmenu_menuitem_foreach(priv->root, popdown_all, client); + g_object_unref(priv->root); priv->root = NULL; } |