aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-01-26 16:27:50 -0600
committerTed Gould <ted@gould.cx>2011-01-26 16:27:50 -0600
commite5078ed1027e8c466d081183eeee6888b10ef510 (patch)
treec118d8f5da95c719cf6708900b0205b5a825d719
parentfe464dc002ed3e2e713f64145e689f66ad51f275 (diff)
downloadlibdbusmenu-e5078ed1027e8c466d081183eeee6888b10ef510.tar.gz
libdbusmenu-e5078ed1027e8c466d081183eeee6888b10ef510.tar.bz2
libdbusmenu-e5078ed1027e8c466d081183eeee6888b10ef510.zip
No really, read the comment and make sure that only happens on the highest level
-rw-r--r--libdbusmenu-gtk/parser.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c
index b1e7e01..27ac926 100644
--- a/libdbusmenu-gtk/parser.c
+++ b/libdbusmenu-gtk/parser.c
@@ -118,15 +118,17 @@ parse_menu_structure_helper (GtkWidget * widget, RecurseContext * recurse)
*
* Note that this will not force menuitems in submenus to be updated as well.
*/
- GList *children = gtk_container_get_children (GTK_CONTAINER (widget));
+ if (recurse->parent == NULL) {
+ GList *children = gtk_container_get_children (GTK_CONTAINER (widget));
- for (; children != NULL; children = children->next) {
- gtk_menu_shell_activate_item (GTK_MENU_SHELL (widget),
- children->data,
- TRUE);
- }
+ for (; children != NULL; children = children->next) {
+ gtk_menu_shell_activate_item (GTK_MENU_SHELL (widget),
+ children->data,
+ TRUE);
+ }
- g_list_free (children);
+ g_list_free (children);
+ }
if (recurse->parent == NULL) {
recurse->parent = dbusmenu_menuitem_new();