diff options
author | Vinicius Costa Gomes <vcgomes@gmail.com> | 2016-05-03 14:56:27 -0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2016-05-04 17:50:28 +0300 |
commit | 6aa1c4488ee96fd6a209b41b7148b037a888a783 (patch) | |
tree | e26f51c9876105e44637946a0cf440ded8a3214e /gdbus/gdbus.h | |
parent | 63c8fe7a4afb8e84c32a74b86934e49d0631584a (diff) | |
download | bluez-6aa1c4488ee96fd6a209b41b7148b037a888a783.tar.gz |
gdbus: Fix the ordering of signals
Consider the following example:
/foo
properties: "A", "B"
/bar
properties: "C", "D"
If during a given mainloop iteration, property "A" of object '/foo' is
changed, then properties "C" and "D" of '/bar', lastly "B" of '/foo',
the current code will emit the PropertiesChanged signals in following
order: "A", "B", "C", "D".
This may confuse applications that have a dependency on the order of
those signals.
This fixes the ordering, so in the example, the order becomes:
"C", "D", "A", B". This is considered not to be a problem, as
applications may use the flag G_DBUS_PROPERTY_CHANGED_FLAG_FLUSH, so
property changed signals are emitted as soon as possible.
The solution is for each object, to reschedule the signals every time a
signal is emitted.
Diffstat (limited to 'gdbus/gdbus.h')
-rw-r--r-- | gdbus/gdbus.h | 9 |
1 files changed, 9 insertions, 0 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); |