From 79b35c31c76b75c16ad024d7ed002ea2e694b823 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 1 Oct 2009 14:41:52 -0500 Subject: Message for realized --- libdbusmenu-gtk/menu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libdbusmenu-gtk/menu.c b/libdbusmenu-gtk/menu.c index 5bcf0a1..ba7ddc3 100644 --- a/libdbusmenu-gtk/menu.c +++ b/libdbusmenu-gtk/menu.c @@ -223,6 +223,7 @@ root_child_delete (DbusmenuMenuitem * root, DbusmenuMenuitem * child, DbusmenuGt static void child_realized (DbusmenuMenuitem * child, gpointer userdata) { + g_debug("Root child realized"); g_return_if_fail(DBUSMENU_IS_GTKMENU(userdata)); DbusmenuGtkMenu * menu = DBUSMENU_GTKMENU(userdata); -- cgit v1.2.3 From 618fd007fca561e2451ff0c31b4158178a150a7d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 1 Oct 2009 14:50:36 -0500 Subject: Trying to handle the reorder part of child_added --- libdbusmenu-gtk/menu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libdbusmenu-gtk/menu.c b/libdbusmenu-gtk/menu.c index ba7ddc3..612709e 100644 --- a/libdbusmenu-gtk/menu.c +++ b/libdbusmenu-gtk/menu.c @@ -192,7 +192,15 @@ static void root_child_added (DbusmenuMenuitem * root, DbusmenuMenuitem * child, guint position, DbusmenuGtkMenu * menu) { g_debug("Root new child"); + DbusmenuGtkMenuPrivate * priv = DBUSMENU_GTKMENU_GET_PRIVATE(menu); + g_signal_connect(G_OBJECT(child), DBUSMENU_MENUITEM_SIGNAL_REALIZED, G_CALLBACK(child_realized), menu); + + GtkWidget * item = GTK_WIDGET(dbusmenu_gtkclient_menuitem_get(priv->client, child)); + if (item != NULL) { + gtk_menu_append(GTK_MENU(menu), item); + gtk_menu_reorder_child(GTK_MENU(menu), item, dbusmenu_menuitem_get_position(root, child)); + } return; } -- cgit v1.2.3