aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-04-03 11:57:10 -0500
committerTed Gould <ted@gould.cx>2012-04-03 11:57:10 -0500
commitd5eb39fd5b2944ec416bda0cc0d0528b0555bf33 (patch)
tree8c585c5b0413368a3c813d5cd175a06455b4441e
parentacb279c7302c663537fdc1827fba7564d6e58f27 (diff)
downloadlibdbusmenu-d5eb39fd5b2944ec416bda0cc0d0528b0555bf33.tar.gz
libdbusmenu-d5eb39fd5b2944ec416bda0cc0d0528b0555bf33.tar.bz2
libdbusmenu-d5eb39fd5b2944ec416bda0cc0d0528b0555bf33.zip
Fill out the group callback to update if we need it
-rw-r--r--libdbusmenu-glib/client.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index e9801b0..2828a1f 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -1858,7 +1858,37 @@ about_to_show_finish_pntr (gpointer data, gpointer user_data)
static void
about_to_show_group_cb (GObject * proxy, GAsyncResult * res, gpointer userdata)
{
+ GError * error = NULL;
+ GList * showers = (GList *)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_group: %s", error->message);
+ /* Note: we're just ensuring only the callback gets called */
+ g_error_free(error);
+ error = NULL;
+ } else {
+ GVariant * updates = g_variant_get_child_value(params, 0);
+ GVariantIter iter;
+
+ /* Okay, so this is kinda interesting. We actually don't care which
+ entries asked us to update the structure, as it's quite simply a
+ single structure. So if we have any ask, we get the update once to
+ avoid itterating through all the structures. */
+ if (g_variant_iter_init(&iter, updates) > 0) {
+ about_to_show_t * first = (about_to_show_t *)showers->data;
+ update_layout(first->client);
+ }
+
+ g_variant_unref(updates);
+ g_variant_unref(params);
+ params = NULL;
+ }
+ g_list_foreach(showers, about_to_show_finish_pntr, GINT_TO_POINTER(FALSE));
+ g_list_free(showers);
return;
}