aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-02-23 12:58:52 -0600
committerTed Gould <ted@gould.cx>2011-02-23 12:58:52 -0600
commit10859b3dd0cf399aa02a5adf7f848bb2e61121e5 (patch)
tree117350911ea7cd854d4abff61ef41564fdc043f4 /libdbusmenu-glib
parent749be25d3f7736e518b3d33d3d64349118bfdf84 (diff)
downloadlibdbusmenu-10859b3dd0cf399aa02a5adf7f848bb2e61121e5.tar.gz
libdbusmenu-10859b3dd0cf399aa02a5adf7f848bb2e61121e5.tar.bz2
libdbusmenu-10859b3dd0cf399aa02a5adf7f848bb2e61121e5.zip
Search for and process type first
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r--libdbusmenu-glib/client.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index b6a00fc..6e25ba1 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -1492,10 +1492,22 @@ parse_layout_xml(DbusmenuClient * client, GVariant * layout, DbusmenuMenuitem *
menu item. Sometimes they may just be copies */
if (childmi != NULL) {
GVariantIter iter;
- g_variant_iter_init(&iter, g_variant_get_child_value(child, 1));
gchar * prop;
GVariant * value;
+ /* Set the type first as it can manage the behavior of
+ all other properties. */
+ g_variant_iter_init(&iter, g_variant_get_child_value(child, 1));
+ while (g_variant_iter_next(&iter, "{sv}", &prop, &value)) {
+ if (g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_TYPE) == 0) {
+ dbusmenu_menuitem_property_set_variant(childmi, prop, value);
+ }
+ g_free(prop);
+ g_variant_unref(value);
+ }
+
+ /* Now go through and do all the properties. */
+ g_variant_iter_init(&iter, g_variant_get_child_value(child, 1));
while (g_variant_iter_next(&iter, "{sv}", &prop, &value)) {
dbusmenu_menuitem_property_set_variant(childmi, prop, value);
g_free(prop);