diff options
author | Ted Gould <ted@gould.cx> | 2011-03-09 08:30:12 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-03-09 08:30:12 -0600 |
commit | b9fd862324444b0bc9256dfa43f1381c2d736a05 (patch) | |
tree | de62a41ebb9073c79e18fbf29b85991f1983b633 /libdbusmenu-gtk/parser.c | |
parent | f6f6a7dffdb9501824c4801696853fa3e0723c33 (diff) | |
parent | b75477d3520217942159625e9dfac3001a4b5d49 (diff) | |
download | libdbusmenu-b9fd862324444b0bc9256dfa43f1381c2d736a05.tar.gz libdbusmenu-b9fd862324444b0bc9256dfa43f1381c2d736a05.tar.bz2 libdbusmenu-b9fd862324444b0bc9256dfa43f1381c2d736a05.zip |
Setting the cache and allowing reparenting of items
Diffstat (limited to 'libdbusmenu-gtk/parser.c')
-rw-r--r-- | libdbusmenu-gtk/parser.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index cf2003f..b0a5cfd 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -219,6 +219,7 @@ new_menuitem (GtkWidget * widget) pdata->widget = widget; g_object_add_weak_pointer(G_OBJECT (widget), (gpointer*)&pdata->widget); + g_object_set_data(G_OBJECT(widget), CACHED_MENUITEM, item); return item; } @@ -311,6 +312,10 @@ parse_menu_structure_helper (GtkWidget * widget, RecurseContext * recurse) /* Oops, let's tell our parents about us */ if (peek == NULL) { + if (dbusmenu_menuitem_get_parent(thisitem) != NULL) { + dbusmenu_menuitem_unparent(thisitem); + } + gint pos = get_child_position (widget); if (pos >= 0) dbusmenu_menuitem_child_add_position (recurse->parent, |