From: Philip Withnall Date: Thu, 20 Feb 2025 18:15:43 +0000 (+0000) Subject: docs: Clarify that login1 signals are not emitted for convenience objects X-Git-Tag: v257.4~48 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=afc6244bb1accde277359e3aa7b1976cc96080cf;p=thirdparty%2Fsystemd.git docs: Clarify that login1 signals are not emitted for convenience objects While this is obvious if you spend a few minutes thinking about how D-Bus signals work (in this case, they are broadcast from a system service, so cannot apply to a specific user/session/seat), it’s a bit easy to overlook this while putting code together which uses the login1 D-Bus API, so it’s helpful to point this hazard out specifically in the docs. The signals can only be emitted on the canonical objects. The convenience objects are useful for method calls, as the calling context can be used to dereference ‘self’ and ‘auto’, but this can’t work for signals. Signed-off-by: Philip Withnall (cherry picked from commit 82b32b997c51e259ddf66a0ec6bd7631b0ea781d) --- diff --git a/man/org.freedesktop.login1.xml b/man/org.freedesktop.login1.xml index 65618356d7e..fda93450b06 100644 --- a/man/org.freedesktop.login1.xml +++ b/man/org.freedesktop.login1.xml @@ -1002,6 +1002,11 @@ node /org/freedesktop/login1/seat/seat0 { CanGraphical, CanTTY, or the idle state changes, PropertyChanged signals are sent out to clients which have subscribed. + + Signals are only emitted on objects referencing a specific seat ID, not on the + /org/freedesktop/login1/seat/self or + /org/freedesktop/login1/seat/auto convenience objects, as they can only be + dereferenced relative to a method caller. @@ -1122,6 +1127,10 @@ node /org/freedesktop/login1/user/_1000 { Whenever Sessions or the idle state changes, PropertyChanged signals are sent out to clients which have subscribed. + + Signals are only emitted on objects referencing a specific UID, not on the + /org/freedesktop/login1/user/self convenience object, as self + can only be dereferenced relative to a method caller. @@ -1483,6 +1492,11 @@ node /org/freedesktop/login1/session/1 { screen-locked/unlocked. A session manager of the session should listen to this signal and act accordingly. This signal is sent out as a result of the Lock() and Unlock() methods, respectively. + + Signals are only emitted on objects referencing a specific session ID, not on the + /org/freedesktop/login1/session/self or + /org/freedesktop/login1/session/auto convenience objects, as they can only be + dereferenced relative to a method caller.