Louvre
v2.12.0-1
C++ library for Wayland compositors
|
Manages session lock requests and state changes. More...
Public Types | |
enum | State |
Represents the state of the session. More... | |
Public Types inherited from LFactoryObject | |
enum class | Type : Int32 |
Base factory object types. More... | |
Public Member Functions | |
LSessionLockManager (const void *params) noexcept | |
LSessionLockManager class constructor. More... | |
~LSessionLockManager () | |
Destructor of the LSessionLockManager class. More... | |
LClient * | client () const noexcept |
Gets the client locking the session. More... | |
const std::vector< LSessionLockRole * > & | roles () const noexcept |
Gets the Session Lock Surface Roles. More... | |
State | state () const noexcept |
Gets the current state of the session. More... | |
void | forceUnlock () |
Forces the session to unlock. More... | |
virtual bool | lockRequest (LClient *client) |
Handles a lock request from a client. More... | |
virtual void | stateChanged () |
Notifies a change in the session state. More... | |
Public Member Functions inherited from LFactoryObject | |
Type | factoryObjectType () const noexcept |
Gets the base factory object type. More... | |
Public Member Functions inherited from LObject | |
LObject (const LObject &) noexcept | |
Copy constructor. More... | |
LObject & | operator= (const LObject &) noexcept |
Assignment operator (each object has its own individual LWeak reference count). More... | |
void | setUserData (UIntPtr data) const noexcept |
Store an unsigned integer value/pointer. More... | |
UIntPtr | userData () const noexcept |
Retrieves the stored unsigned integer value/pointer. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from LObject | |
LObject () noexcept=default | |
Constructor of the LObject class. More... | |
virtual | ~LObject () noexcept |
Destructor of the LObject class. More... | |
void | notifyDestruction () noexcept |
Notifies the object destruction. More... | |
Manages session lock requests and state changes.
Clients using the Session Lock protocol can request the compositor to lock the user session and display arbitrary graphics (see LSessionLockRole) such as an authentication form to allow the user to unlock the session.
This class allows you to accept/decline such requests (see lockRequest()) and monitor changes in the session state (stateChanged()).
enum State |
|
noexcept |
LSessionLockManager class constructor.
There is only one instance of LSessionLockManager, which can be accessed from LCompositor::sessionLockManager().
params | Internal parameters provided in LCompositor::createObjectRequest(). |
|
inline |
Destructor of the LSessionLockManager class.
Invoked after LCompositor::onAnticipatedObjectDestruction().
|
noexcept |
Gets the client locking the session.
nullptr
if the session is unlocked or the locking client died.
|
noexcept |
Gets the Session Lock Surface Roles.
The client creates one for each output.
|
inlinenoexcept |
Gets the current state of the session.
void forceUnlock | ( | ) |
Forces the session to unlock.
If the locking client dies without unlocking the session, the session remains locked (DeadLocked state). This method allows the compositor to forcibly unlock the session, ideally after a fallback user authentication mechanism.
|
virtual |
Handles a lock request from a client.
This method determines whether to grant permission for the client to lock the session. Returning true
indicates permission, while false
denies the request.
This method is only invoked when the session state is Unlocked or DeadLocked. Louvre automatically ignores requests in the Locked state.
client | The client requesting to lock the session. |
|
virtual |
Notifies a change in the session state.