Bug 15425

Summary: Make the 'loaded' desktop dbus signal unracey
Product: [Yocto Project Subprojects] Matchbox Reporter: Ross Burton <ross.burton>
Component: matchboxAssignee: Ross Burton <ross.burton>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Medium CC: randy.macleod
Version: unspecified   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2024-03-07 12:13:01 UTC
Currently the desktop will emit a 'loaded' signal over dbus when its loaded, and other pieces may use dbus-wait to wait for the desktop to be loaded before doing more. Currently the keyboard does this.

It would also make sense for the runtime image testing to watch for the signal to say that the desktop is close enough to being usable.

However, as this is a one-time signal there's a huge race condition: what if the signal is fired before it is watched for?

The solution to this would be for the desktop to take ownership of org.matchbox.Desktop or similar on the bus. This can be checked at any time, and signals sent when it is acquired, so can be race-free.

For example: https://docs.gtk.org/gio/migrating-gdbus.html#owning-bus-names
Comment 1 Ross Burton 2024-03-07 12:13:38 UTC
It would be sensible to change dbus-wait to support both waiting for a signal or checking if a name exists.