aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-07-20 09:38:13 -0500
committerTed Gould <ted@gould.cx>2010-07-20 09:38:13 -0500
commit08fae7619012309a0ef9024c1e91effc7bf99529 (patch)
treec81539e29b9be5204ad0066c13f7e90ad560135f /libdbusmenu-glib
parentf034bdd080b7579b0e5e57c8f34780a756bb8b17 (diff)
downloadlibdbusmenu-08fae7619012309a0ef9024c1e91effc7bf99529.tar.gz
libdbusmenu-08fae7619012309a0ef9024c1e91effc7bf99529.tar.bz2
libdbusmenu-08fae7619012309a0ef9024c1e91effc7bf99529.zip
Tracking who we reply to, and ensuring that we reply to everyone.
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r--libdbusmenu-glib/client.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index ab00636..4faf7c6 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -94,10 +94,10 @@ struct _newItemPropData
typedef struct _properties_listener_t properties_listener_t;
struct _properties_listener_t {
- DbusmenuClient * client;
gint id;
org_ayatana_dbusmenu_get_properties_reply callback;
gpointer user_data;
+ gboolean replied;
};
#define DBUSMENU_CLIENT_GET_PRIVATE(o) \
@@ -398,11 +398,22 @@ get_properties_callback (DBusGProxy *proxy, GPtrArray *OUT_properties, GError *e
properties_listener_t * listener = find_listener(listeners, 0, id);
listener->callback(proxy, properties, NULL, listener->user_data);
+ listener->replied = TRUE;
}
/* Provide errors for those who we can't */
+ GError * localerror = NULL;
for (i = 0; i < listeners->len; i++) {
-
+ properties_listener_t * listener = &g_array_index(listeners, properties_listener_t, i);
+ if (!listener->replied) {
+ if (localerror == NULL) {
+ g_set_error_literal(&localerror, 0, 0, "Error getting properties for ID");
+ }
+ listener->callback(proxy, NULL, localerror, listener->user_data);
+ }
+ }
+ if (localerror != NULL) {
+ g_error_free(localerror);
}
/* Clean up */
@@ -477,10 +488,10 @@ get_properties_globber (DbusmenuClient * client, gint id, const gchar ** propert
}
properties_listener_t listener = {0};
- listener.client = client;
listener.id = id;
listener.callback = callback;
listener.user_data = user_data;
+ listener.replied = FALSE;
g_array_append_val(priv->delayed_property_listeners, listener);