diff options
author | Chris Coulson <chrisccoulson@ubuntu.com> | 2011-03-08 23:00:45 +0000 |
---|---|---|
committer | Chris Coulson <chrisccoulson@ubuntu.com> | 2011-03-08 23:00:45 +0000 |
commit | b75477d3520217942159625e9dfac3001a4b5d49 (patch) | |
tree | 9b0ceddcf346d856ba9c4f02b282bb8b279105cc /libdbusmenu-gtk/parser.c | |
parent | 1a1e6c4c24276b7d921d729c277e0c2fd7405d40 (diff) | |
download | libdbusmenu-b75477d3520217942159625e9dfac3001a4b5d49.tar.gz libdbusmenu-b75477d3520217942159625e9dfac3001a4b5d49.tar.bz2 libdbusmenu-b75477d3520217942159625e9dfac3001a4b5d49.zip |
Ensure we set the CACHED_MENUITEM data on GtkWidget's
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, |