aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-03-08 14:53:54 -0600
committerTed Gould <ted@gould.cx>2011-03-08 14:53:54 -0600
commit3efb996d90178b9c0d615c5237c0e39328479bd2 (patch)
tree34772fe357bcf63cc7d404306be04c25b5ffc56d
parentb0b55b00b2460f3430b661e8cbc43e6a07759e66 (diff)
downloadlibdbusmenu-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.c14
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