summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdbus/gdbus.h9
-rw-r--r--gdbus/object.c12
2 files changed, 19 insertions, 2 deletions
diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index 69fbc107c..e37385fa1 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -302,6 +302,15 @@ void g_dbus_pending_property_error_valist(GDBusPendingReply id,
const char *name, const char *format, va_list args);
void g_dbus_pending_property_error(GDBusPendingReply id, const char *name,
const char *format, ...);
+
+/*
+ * Note that when multiple properties for a given object path are changed
+ * in the same mainloop iteration, they will be grouped with the last
+ * property changed. If this behaviour is undesired, use
+ * g_dbus_emit_property_changed_full() with the
+ * G_DBUS_PROPERTY_CHANGED_FLAG_FLUSH flag, causing the signal to ignore
+ * any grouping.
+ */
void g_dbus_emit_property_changed(DBusConnection *connection,
const char *path, const char *interface,
const char *name);
diff --git a/gdbus/object.c b/gdbus/object.c
index a2201016c..afb458764 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -635,11 +635,19 @@ static gboolean g_dbus_args_have_signature(const GDBusArgInfo *args,
static void add_pending(struct generic_data *data)
{
- if (data->process_id > 0)
- return;
+ guint old_id = data->process_id;
data->process_id = g_idle_add(process_changes, data);
+ if (old_id > 0) {
+ /*
+ * If the element already had an old idler, remove the old one,
+ * no need to re-add it to the pending list.
+ */
+ g_source_remove(old_id);
+ return;
+ }
+
pending = g_slist_append(pending, data);
}