diff options
author | Ted Gould <ted@gould.cx> | 2011-03-08 14:53:54 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-03-08 14:53:54 -0600 |
commit | 3efb996d90178b9c0d615c5237c0e39328479bd2 (patch) | |
tree | 34772fe357bcf63cc7d404306be04c25b5ffc56d | |
parent | b0b55b00b2460f3430b661e8cbc43e6a07759e66 (diff) | |
download | libdbusmenu-3efb996d90178b9c0d615c5237c0e39328479bd2.tar.gz libdbusmenu-3efb996d90178b9c0d615c5237c0e39328479bd2.tar.bz2 libdbusmenu-3efb996d90178b9c0d615c5237c0e39328479bd2.zip |
Removing the dbusmenu menuitem from the parent if it gets removed on the GTK side
-rw-r--r-- | libdbusmenu-gtk/parser.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index bde460d..b66aa46 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -884,8 +884,22 @@ child_added_cb (GtkContainer *menu, GtkWidget *widget, gpointer data) static void child_removed_cb (GtkContainer *menu, GtkWidget *widget, gpointer data) { + gpointer pmi = g_object_get_data(G_OBJECT(widget), CACHED_MENUITEM); + if (pmi == NULL) { + return; + } + DbusmenuMenuitem * child = DBUSMENU_MENUITEM(pmi); + pmi = g_object_get_data(G_OBJECT(menu), CACHED_MENUITEM); + if (pmi == NULL) { + return; + } + + DbusmenuMenuitem * parent = DBUSMENU_MENUITEM(pmi); + + dbusmenu_menuitem_child_delete(parent, child); + return; } static void |