diff options
author | Ted Gould <ted@gould.cx> | 2011-02-18 14:07:18 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-02-18 14:07:18 -0600 |
commit | b19de3c3c90df6420200c6ba45ba45060382cca2 (patch) | |
tree | 4d4fc9fc0c1e321eb0ff18d1db93a7442b451846 | |
parent | a128fd2e85e2f442522c280a6d1d22663e8cdfea (diff) | |
download | libdbusmenu-b19de3c3c90df6420200c6ba45ba45060382cca2.tar.gz libdbusmenu-b19de3c3c90df6420200c6ba45ba45060382cca2.tar.bz2 libdbusmenu-b19de3c3c90df6420200c6ba45ba45060382cca2.zip |
Set a fixed set of properties that we ask for when requesting the layout
-rw-r--r-- | libdbusmenu-glib/client.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index ba4ae7e..ca32d48 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -79,6 +79,7 @@ struct _DbusmenuClientPrivate GCancellable * menuproxy_cancel; GCancellable * layoutcall; + GVariant * layout_props; gint current_revision; gint my_revision; @@ -316,6 +317,13 @@ dbusmenu_client_init (DbusmenuClient *self) priv->layoutcall = NULL; + gchar * layout_props[3]; + 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); + g_variant_ref_sink(priv->layout_props); + priv->current_revision = 0; priv->my_revision = 0; @@ -380,6 +388,11 @@ dbusmenu_client_dispose (GObject *object) priv->layoutcall = NULL; } + if (priv->layout_props != NULL) { + g_variant_unref(priv->layout_props); + priv->layout_props = NULL; + } + /* Bring down the menu proxy, ensure we're not looking for one at the same time. */ if (priv->menuproxy_cancel != NULL) { @@ -1662,7 +1675,7 @@ update_layout (DbusmenuClient * client) g_variant_builder_add_value(&tupleb, g_variant_new_int32(0)); // root g_variant_builder_add_value(&tupleb, g_variant_new_int32(-1)); // recurse - g_variant_builder_add_value(&tupleb, g_variant_new_array(G_VARIANT_TYPE_STRING, NULL, 0)); // props + g_variant_builder_add_value(&tupleb, priv->layout_props); // props GVariant * args = g_variant_builder_end(&tupleb); // g_debug("Args (type: %s): %s", g_variant_get_type_string(args), g_variant_print(args, TRUE)); |