On the dialog windows for unlock the screensaver, "Switch user" button is missing.
This occurs when Xfce4-screensaver is launched by systemd (auto-launch with session start)
If I kill xfce4-screensaver, then re-launch it, lock screen -> "Switch user" button is present
--
OS : OpenSUSE Leap 15.1
Xfce 4.14.2
xfce4-screensaver 0.1.10-lp151.17.1
I just looked at this issue on my Arch/xfce4 system and it appears to actually not be started directly by systemd. However, it is started as dbus service which is started by the systemd unit debus.service for the user session.
I was able to workaround this by disabling the dbus service on Arch by renaming /usr/share/dbus-1/services/org.xfce.ScreenSaver.service ==> /usr/share/dbus-1/services/org.xfce.ScreenSaver.service.off
Then be sure to confirm the xfce4-screensaver is enabled in /etc/xdg/autostart.
Now when screensaver is started or screen is locked the "Switch User" button appears.
Anybody have any idea on what could be the root cause of this issue?
Exactly, it is started as dbus service which is started by the systemd (I'm not an expert...)
The workaround is working for me on OpenSUSE (disable the dbus service and let the autostart desktop launcher).
However, the variable is set in my session :
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
But I think the env variable XDG_SEAT_PATH is set after dbus has launched the org.xfce.ScreenSaver.service
Because if I modify the /usr/share/dbus-1/services/org.xfce.ScreenSaver.service file with :
Is there any reason this has to be started by dbus?
Because maybe the solution is to change the xfce4 screensaver package not to drop in dbus service definition and just rely on xdg autostart.
I think this is a big issue b/c on shared computers you must be able to have the screen save and lock but also let somebody else start a session. For a while i switched to other screensavers/lockers like xscreensaver and light-locker but i think xfce4-screensaver integrates best with xfc4 - obviously.
I did some investigations on my Fedora 33 and it turns out that org.xfce.Screensaver D-bus service is activated only when dbus-broker is used as dbus implementation. According to dbus-broker-launch manpage:
dbus-broker-launch activates all services as systemd units. Services that already come with a systemd-unit are activated as usual, but services that lack a systemd unit are activated as transient unit, with an ad-hoc unit-file generated at runtime. This guarantees that all services run in a well-defined environment.
I created a simple service that simply echoes current time to stderr to check this, put corresponding .service file to /usr/share/dbus-1/services, restarted session bus and found out that the service was activated unconditionally and it's parent process is, obviously, systemd. The same is for xfce4-screensaver: it is launched by dbus-broker-launch by unconditional activation of org.xfce.ScreenSaver. No user switch button on lock screen.
Then I switched from dbus-broker to vanilla dbus-daemon, restarted session and found that xfce4-screensaver is launched as a child process of xfce4-session and the user switch button is present on screen unlock form. As one can see, dbus-daemon doesn't activate dbus-services on start, while dbus-broker does: it doesn't even create transient systemd units mentioned above.
Looking through their launcher source code, I couldn't find a way to disable services auto-activation on bus start. For the moment, it seems that for the systems with dbus-broker session bus there is no option but removing org.xfce.ScreenSaver.service file to fallback to xfce4-session autostart mechanism. (But won't this break something else?)
My personal choice is to switch back to dbus-daemon because I don't think it's a good idea to launch a bulk of services unconditionally - but this should be discussed in dbus-broker's issue tracker, not here, obviously.
So a work-around for this problem would be to disable /usr/share/dbus-1/services/org.xfce.ScreenSaver.service file:
sudo mv /usr/share/dbus-1/services/org.xfce.ScreenSaver.service /usr/share/dbus-1/services/org.xfce.ScreenSaver.service.orig# And to prevent future upgrade or reinstall of xfce4-screensaver package from restoring the filesudo tee /usr/share/dbus-1/services/org.xfce.ScreenSaver.service < /dev/null
One option is to modify the service launched by dbus to specify the DM by hand. By using a wrapper for instance.
By looking at the source-code it seems like mdm and gdm are detected by process presence while lightdm by env var presence. Maybe the detection is wrong as the variable is only present in a fully running environment and the dev tested it by running the service directly and not via dbus activation. And that makes sense from a dev point of view.
So why lightdm is not detected by process presence too ? Dev found the variable and thought it was nicer to rely on this that scan for process name. Well that seemed a good idea but in practice, the variable is not reliable enough.
So the patch maybe just } else if (process_is_running ("lightdm")) {