diff options
author | Ted Gould <ted@gould.cx> | 2010-02-13 01:06:39 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-13 01:06:39 -0600 |
commit | 8021b8e5434ecc2d76495c1d3e52cc9a0691852a (patch) | |
tree | cc823270111c4e43d97af784141cca8dbd170e66 /libdbusmenu-glib | |
parent | decf0a8c7b80762acfc1d54ecc7c0d2ea1a41ad7 (diff) | |
download | libdbusmenu-8021b8e5434ecc2d76495c1d3e52cc9a0691852a.tar.gz libdbusmenu-8021b8e5434ecc2d76495c1d3e52cc9a0691852a.tar.bz2 libdbusmenu-8021b8e5434ecc2d76495c1d3e52cc9a0691852a.zip |
Properly handing a child changing to make sure to recurse down the structure setting up the signals.
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/server.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index f8267c2..15ec281 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -301,10 +301,29 @@ menuitem_property_changed (DbusmenuMenuitem * mi, gchar * property, GValue * val return; } +/* Adds the signals for this entry to the list and looks at + the children of this entry to add the signals we need + as well. We like signals. */ +static void +added_check_children (gpointer data, gpointer user_data) +{ + DbusmenuMenuitem * mi = (DbusmenuMenuitem *)data; + DbusmenuServer * server = (DbusmenuServer *)user_data; + + menuitem_signals_create(mi, server); + g_list_foreach(dbusmenu_menuitem_get_children(mi), added_check_children, server); + + return; +} + +/* Callback for when a child is added. We need to connect everything + up and signal that the layout has changed. */ static void menuitem_child_added (DbusmenuMenuitem * parent, DbusmenuMenuitem * child, guint pos, DbusmenuServer * server) { menuitem_signals_create(child, server); + g_list_foreach(dbusmenu_menuitem_get_children(child), added_check_children, server); + /* TODO: We probably need to group the layout update signals to make the number more reasonble. */ DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server); priv->layout_revision++; |