diff options
author | Ted Gould <ted@gould.cx> | 2010-11-15 15:29:34 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-11-15 15:29:34 -0600 |
commit | c4882fb11cece780073e56ba186e87b9cc2e90d7 (patch) | |
tree | 00fde56fa2f05bd06cca33f8cf4df295b0850aee | |
parent | 187694edd077b979c6e19c511b5227791c3cd3f6 (diff) | |
download | libdbusmenu-c4882fb11cece780073e56ba186e87b9cc2e90d7.tar.gz libdbusmenu-c4882fb11cece780073e56ba186e87b9cc2e90d7.tar.bz2 libdbusmenu-c4882fb11cece780073e56ba186e87b9cc2e90d7.zip |
Switching over our call to AboutToShow
-rw-r--r-- | libdbusmenu-glib/client.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 2027e7a..ab3730d 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1306,14 +1306,22 @@ struct _about_to_show_t { /* Reports errors and responds to update request that were a result of sending the about to show signal. */ static void -about_to_show_cb (GDBusProxy * proxy, gboolean need_update, GError * error, gpointer userdata) +about_to_show_cb (GObject * proxy, GAsyncResult * res, gpointer userdata) { + gboolean need_update = FALSE; + GError * error = NULL; about_to_show_t * data = (about_to_show_t *)userdata; + GVariant * params = NULL; + + params = g_dbus_proxy_call_finish(G_DBUS_PROXY(proxy), res, &error); if (error != NULL) { g_warning("Unable to send about_to_show: %s", error->message); /* Note: we're just ensuring only the callback gets called */ need_update = FALSE; + } else { + g_variant_get(params, "b", &need_update); + g_variant_unref(params); } /* If we need to update, do that first. */ @@ -1344,7 +1352,14 @@ dbusmenu_client_send_about_to_show(DbusmenuClient * client, gint id, void (*cb)( data->cb_data = cb_data; g_object_ref(client); - org_ayatana_dbusmenu_about_to_show_async (priv->menuproxy, id, about_to_show_cb, data); + g_dbus_proxy_call(priv->menuproxy, + "AboutToShow", + g_variant_new("i", id), + G_DBUS_CALL_FLAGS_NONE, + -1, /* timeout */ + NULL, /* cancellable */ + about_to_show_cb, + data); return; } |