diff options
author | Ted Gould <ted@gould.cx> | 2011-03-01 11:24:25 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-03-01 11:24:25 -0600 |
commit | a2e4b9e83822717c4096a35fdfcfc55f48dea8df (patch) | |
tree | fba906cdabcd828d82b68c069e004de1557e5aaf | |
parent | dcff1ffdeee9fb8ecbf03f7e030b7815e34b401f (diff) | |
parent | e319dcd8d8b2436b1f3bd5f8749b93c08f176251 (diff) | |
download | libdbusmenu-a2e4b9e83822717c4096a35fdfcfc55f48dea8df.tar.gz libdbusmenu-a2e4b9e83822717c4096a35fdfcfc55f48dea8df.tar.bz2 libdbusmenu-a2e4b9e83822717c4096a35fdfcfc55f48dea8df.zip |
Adding a weak pointer to the submenu
-rw-r--r-- | libdbusmenu-gtk/parser.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 8045b7f..8420770 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -456,6 +456,17 @@ construct_dbusmenu_for_widget (GtkWidget * widget) } } + GtkWidget *submenu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(widget)); + if (submenu) + { + pdata->shell = submenu; + g_signal_connect (G_OBJECT (submenu), + "child-added", + G_CALLBACK (child_added_cb), + mi); + g_object_add_weak_pointer(G_OBJECT(submenu), (gpointer*)&pdata->shell); + } + if (!g_object_get_data (G_OBJECT (widget), "gtk-empty-menu-item") && !GTK_IS_TEAROFF_MENU_ITEM (widget)) { visible = gtk_widget_get_visible (widget); |