This commit introduces AbstractLocker class, which can be subclassed to
provide platform specific implementation of LockScreen, for example
X11Locker and WaylandLocker.
REVIEW: 125802
If the greeter crashes on startup ksld is caught in a restart loop which
causes 100 % CPU usage and makes it impossible to unlock the session.
With this change the greeter is only allowed to crash four times and
ksld goes into an emergency mode. This mode ensures that our black
background window gets shown with a message indicating how to unlock
using loginctl. This is rather technical but better than leaving the
system in a state which makes it impossible to unlock.
Directly unlocking in the error case is not an option as that could
be used to attack the screen locker infrastructure.
BUG: 351696
REVIEW: 124915
This change implements support for white listed global shortcuts in
the lock screen. It interacts with KGlobalAccel to fetch shortcuts
and checks them when a key is pressed. For more detailed information
on how this functions, please see the documentation added to the new
file globalacel.h.
So far only shortcuts from kmix are white listed. This allows to
mute and change volume while the screen is locked.
CCBUG: 148228
CCBUG: 104353
FEATURE: 198097
FIXED-IN: 5.3.0
REVIEW: 122419
When the system is going to sleep we want to ensure that the screen gets
locked before the system goes to sleep. Logind provides the inhibitor
locks which can be used for this.
If logind is available ksld gains an inhibitor lock for sleep when the
screen is unlocked. As soon as the screen gets locked the inhibitor lock
is released. In addition it connects to the prepareForSleep signal by
logind and locks the screen.
The solution needs to be extended to have a config option whether the
screen should be locked on sleep. Currently this is provided by
powerdevil. Also the solution can only work properly if power devil uses
logind's sleep dbus interface.
The LockWindow deep called into KSLDApp to unlock in case of user
activity during grace time. But LockWindow also emits a signal on user
activity. From an architectural point of view it's better to handle this
directly in the KSLDApp and connect to the signal to unlock if it's in
grace time.
Another advantage is that LockWindow now no longer pulls in the KSLDApp
which improves the unit test situation for the LockWindow as the
lockWindowTest no longer needs to link the complete ksld library.
REVIEW: 118160
So far the unit test verifies that:
* screen gets blanked as soon as the first lock window is mapped
* screen stays blanked when the lock window gets destroyed
* screen stays blanked if a window is raised on top of the stack
REVIEW: 118012
The unit test so far only tests establishGrab. This is a little bit
tricky as we need a different X Client which grabs pointer or keyboard
to make establishGrab fail. For that two small helper applications are
included which do nothing else than connecting to X and the one grabbing
keyboard the other grabbing pointer.
The applications are started from the test to get the keyboard/pointer
grabbed which results in ::establishGrab to return false.
What this test is not yet able to test is handling the sleep between two
grab attemps.
As the test is using doUnlock() from KSldApp, the implementation is
changed to use xcb for ungrab pointer/keyboard. With XLib the test would
have needed an XSync which would have required to either add the XLib
call to the test or doUnlock or implement the sync using xcb.
REVIEW: 117995
A new class LogindIntegration is added to the screenlocker. This class
listens to the Lock and Unlock signals emitted by the session object on
the logind service.
This is integrated with the screenlocker application to start or quit the
lock when the signals are emitted. This means a locked screen is unlocked
when the Unlock signal is received from logind. Logind is a higher
authority for the screenlocker and thus follows the requests from logind.
BUG: 314989
REVIEW: 117355