aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-10-01 14:50:36 -0500
committerTed Gould <ted@canonical.com>2009-10-01 14:50:36 -0500
commit618fd007fca561e2451ff0c31b4158178a150a7d (patch)
tree787e362508b3fa6ca6f2091fd61655d64851b292
parent79b35c31c76b75c16ad024d7ed002ea2e694b823 (diff)
downloadlibdbusmenu-618fd007fca561e2451ff0c31b4158178a150a7d.tar.gz
libdbusmenu-618fd007fca561e2451ff0c31b4158178a150a7d.tar.bz2
libdbusmenu-618fd007fca561e2451ff0c31b4158178a150a7d.zip
Trying to handle the reorder part of child_added
-rw-r--r--libdbusmenu-gtk/menu.c8
1 files changed, 8 insertions, 0 deletions
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;
}