diff options
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | libdbusmenu-glib/client.c | 22 |
2 files changed, 23 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog index 26c6edc..116e6a8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,8 +3,12 @@ libdbusmenu (0.3.98-0ubuntu2~ppa5) UNRELEASED; urgency=low * Upstream merge * Handle the case of a single NULL entry as well. * Not checking defaults when value is NULL + * Add the 'type' variable first when processing new + menuitems + * When requesting new layouts get 'enabled' and 'visible' + as well - -- Ted Gould <ted@ubuntu.com> Wed, 23 Feb 2011 11:21:25 -0600 + -- Ted Gould <ted@ubuntu.com> Wed, 23 Feb 2011 13:30:01 -0600 libdbusmenu (0.3.98-0ubuntu2~ppa4) natty; urgency=low diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 9422baf..3c8d5d2 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -334,11 +334,13 @@ dbusmenu_client_init (DbusmenuClient *self) priv->layoutcall = NULL; - gchar * layout_props[3]; + gchar * layout_props[5]; layout_props[0] = DBUSMENU_MENUITEM_PROP_TYPE; layout_props[1] = DBUSMENU_MENUITEM_PROP_LABEL; - layout_props[2] = NULL; - priv->layout_props = g_variant_new_strv((const gchar * const *)layout_props, 2); + layout_props[2] = DBUSMENU_MENUITEM_PROP_VISIBLE; + layout_props[3] = DBUSMENU_MENUITEM_PROP_ENABLED; + layout_props[4] = NULL; + priv->layout_props = g_variant_new_strv((const gchar * const *)layout_props, 4); g_variant_ref_sink(priv->layout_props); priv->current_revision = 0; @@ -1587,10 +1589,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); |