docs: G_APPLICATION_IS_SERVICE insufficiently documented
Gio.ApplicationFlags includes G_APPLICATION_IS_SERVICE
.
The description is not enough to actually make use of it. It currently says:
Run as a service. In this mode, registration fails if the service is already running, and the application will initially wait up to 10 seconds for an initial activation message to arrive.
Just starting the application causes it to exit after the 10 seconds. That's fair, so let's send
an initial activation message
except the docs don't say a word about what kind of a message this is. Is this a dbus message? Is it a signal? Is it some other mechanism? What data does it actually contain?
Looking for answers,
the service
seems to be a dbus service, judging by a mysterious error I'm encountering while debugging:
(gnome-control-center-search-provider:1927190): Gtk-CRITICAL **: 09:33:14.863: Unable to register the application: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not activate remote peer: unit failed.
Sadly, the docs don't provice any info about the dbus side, so it's not clear how to prevent that
the service is already running
and it's not clear what conditions have to be met for the registration to succeed.
To summarize, this flag's docs are only useful if you already know what it does. Fixing this means providing the info:
- Is it a dbus service?
- What constitutes registration?
- What's the initial activation message?