Table of Contents

This page describes the use-cases for user switching, session locking and power management. A describtion of these use-cases is given using xflock + xfpm + light-locker + lightdm. This page should help understand what is happening in which cases and what alternative there are to improve the situation.

Use-Cases

Lock manually

The user wants to lock his session, so he can leave his desk unattended.

The session should be locked immediately and the user expects a lock screen as confirmation the screen is locked.

Contact the display manager directly

xflock calls lightdm lock. A new VT is spawn with the lock screen. De session lock signal is emitted and light-locker protects the session content for showing on the previous VT.

Depending on the gfx driver. If the user switches VT manually it is possible the content of the locked session is shown before light-locker is show. The gfx driver buffers the last image before the VT switch.

Contact light-locker first

xflock calls light-locker lock. light-locker will setup the lockscreen before it call lightdm to lock the session.

light-locker adds a 1 sec timeout before calling lightdm lock. This should be enough to setup the session protection and this image will now be buffered by the gfx driver.

Switch user

Another user wants to login without ending the current session.

The greeter for the new session should be shown immediately.

Contact the display manager directly

calls lightdm switch-to-greeter. A new VT is spawn with the greeter. De session lock signal is emitted and light-locker protects the session content for showing on the previous VT.

Depending on the gfx driver. If the user switches VT manually it is possible the content of the locked session is shown before light-locker is show. The gfx driver buffers the last image before the VT switch.

Contact light-locker first

xflock calls light-locker lock. light-locker will setup the lockscreen before it call lightdm to lock the session.

The lock screen is the same as the greeter. Only for the lock screen the username is already inserted. light-locker adds a 1 sec timeout before calling lightdm lock. This should be enough to setup the session protection and this image will now be buffered by the gfx driver.

Force screensaver

The use wants to save power or for any other reason switch to the screensaver.

Activate the X screensaver

This can be done with xdg-screensaver, xset, light-locker-command.

light-locker will see this as the start of the idle time. And it will start the lock after screensaver timer.

Suspend manually

The user wants to suspend/hibernate the computer.

Assumming he wants his session to be locked on resume.

Tell the init system to suspend

This can be done wich a susspend key, xfsm, xfpm, init call. The init system will emit the suspend signal. light-locker will prepare the session protection on suspend by hiding the content.

On resume the resume signal is emitted. light-locker will call lightdm lock to lock the session. This is done after a short delay to give the current X session some time to restore the gfx. After the lock call the VT is switched to the lock screen.

Lock idle session

The user leaves the session idle. To protect his session in this case the session should be locked after some time.

The user expects the screen to be blank the whole time (screensaver) and the lock screen to be presented when the screensaver is stopped.

Lock directly after timeout

light-locker will start a timer after the screensaver starts. When this timer ends it will call lightdm lock and switch to the lock screen.

To prevent the lockscreen from showing the screensaver needs to be active in the new VT as well. This contradicts other lightdm lock calls.

Lock as the screensaver ends

light-locker will start a timer after the screensaver starts. When this timer ends the session protection is started. When the screensaver it stopped light-locker will call lightdm lock. Switching the session to the lock sreen.

This will add some delay before the session can be unlocked.

Lock on lid close

The user wants his session locked directly when the lid of the computer is closed. When the lid is opened the lock screen should be shown.

Contact the display manager directly

xfpm calls lightdm lock. A new VT is spawn with the greeter. De session lock signal is emitted and light-locker protects the session content for showing on the previous VT.

Depending on the gfx driver. If the user switches VT manually it is possible the content of the locked session is shown before light-locker is show. The gfx driver buffers the last image before the VT switch.

Depending on the gfx driver/hardware. The backlight won't be turned back on when the session is unlocked.

xfpm needs to inhibit the init system not to perform its own actions. It is reported that switching to the lock screen will still activate the init system.

Contact light-locker first

xfpm calls light-locker lock. light-locker will setup the lockscreen before it call lightdm to lock the session. light-locker adds a 1 sec timeout before calling lightdm lock. This should be enough to setup the session protection and this image will now be buffered by the gfx driver.

(Is this true for locking as well?) Depending on the gfx driver. The backlight won't be turned back on when the session is unlocked.

xfpm needs to inhibit the init system not to perform its own actions. It is reported that switching to the lock screen will still activate the init system.

Contact light-locker with late-locking

xfpm calls light-locker lock. light-locker will setup the session protection. When the screensaver it stopped (on lid open. Does that happen?) light-locker will call lightdm lock (A delay might be required for the backlight to restore). Switching the session to the lock sreen.

This contradicts other light-locker lock calls.

Suspend on lid close

The user wants his computer suspended when the lid is closed. When the lid is opened the lock screen should be shown.

Tell the init system to suspend

xfpm calls init system suspennd. The init system will emit the suspend signal. light-locker will prepare the session protection on suspend by hiding the content.

On resume the resume signal is emitted. light-locker will call lightdm lock to lock the session. This is done after a short delay to give the current X session some time to restore the gfx. After the lock call the VT is switched to the lock screen.

This was not reported: Depending on the gfx driver/hardware. The backlight won't be turned back on when the session is unlocked. (maybe more delay will solve this)