0

I am building an MPRIS D-Bus Interface for an application in C using GDBus facilities generated automagically using the gdbus-codegen tool.

When a property is altered, a "PropertiesChanged" signal is automatically generated, which is fine most of the time, but in the MPRIS specification, it states that when the 'Position' property changes, the "PropertiesChanged" signal should not be emitted.

Is there any nice way to prevent the signal being sent?

1 Answers1

1

This is currently not possible, due to a missing feature in GLib. Once that feature is implemented, you should be able to annotate the Position property with org.freedesktop.DBus.Property.EmitsChangedSignal to cause gdbus-codegen to not emit signals for it.

This would use the following introspection XML, for example:

<property name="Position" type="x" access="read">
  <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/>
</property>

If you want to help out on the GLib bug, that would be appreciated (at the least, subscribe to it to hear when it’s fixed). I will try and find time to review the patch soon, but can make no guarantees.

Philip Withnall
  • 5,293
  • 14
  • 28