Sending the org.freedesktop.DisplayManager.Seat.SwitchToGreeter message will not always cause an actual switch, instead doing nothing. This seems to happen if the reply to the message can't be sent, i.e. if the sender of the original message drops off the bus (as I understand it).
This can be reproduced using dbus-send:
$ dbus-send --system --dest=org.freedesktop.DisplayManager /org/freedesktop/DisplayManager/Seat0 org.freedesktop.DisplayManager.Seat.SwitchToGreeter
(nothing happens)
$ dbus-send --print-reply --system --dest=org.freedesktop.DisplayManager /org/freedesktop/DisplayManager/Seat0 org.freedesktop.DisplayManager.Seat.SwitchToGreeter
(switch happens correctly)
i.e. the switch only happens if dbus-send is still there when SDDM tries to send the reply. This is not how it is meant to behave:
sphalerite> dbus-send --system --dest=org.freedesktop.DisplayManager /org/freedesktop/DisplayManager/Seat0 org.freedesktop.DisplayManager.Seat.SwitchToGreeter does nothing unless I also add the option --print-reply. Why would this be?
sphalerite> Given that the side effect of the call is what I want, and I don't really care about the response, surely --print-reply shouldn't be necessary?
thiago> sphalerite: what do you mean by "does nothing"
thiago> are you saying that the called service does not take the action you asked of it?
sphalerite> thiago: doesn't switch to the greeter
sphalerite> yes
thiago> not a D-Bus bug then
thiago> please contact the people who made that service
sphalerite> I don't really understand what's going on there — why would the message's recipient be able to distinguish between the reply being wanted and the reply not being wanted at all?
thiago> there's a flag in the message header indicating whether the caller expects a reply
thiago> it's also possible that dbus-send has already exited by the time the called service receives and processes the call
thiago> depending on how the called service is written, it may get that information that the caller exited
sphalerite> ah right
thiago> for example, it may be asking D-Bus what the PID, UID, etc. are of the caller, which will fail