Louvre  v2.9.0-1
C++ library for Wayland compositors
Public Member Functions | List of all members
LSessionLockRole Class Reference

Surface displayed during a session lock. More...

+ Inheritance diagram for LSessionLockRole:

Public Member Functions

 LSessionLockRole (const void *params) noexcept
 Constructor of the LSessionLockRole class. More...
 
 ~LSessionLockRole ()=default
 Destructor of the LSessionLockRole class. More...
 
LOutputexclusiveOutput () const override
 The output the surface is assigned to. More...
 
virtual const LPointrolePos () const override
 Surface position. More...
 
- Public Member Functions inherited from LBaseSurfaceRole
 LBaseSurfaceRole (LFactoryObject::Type type, LResource *resource, LSurface *surface, UInt32 roleId) noexcept
 Constructor of LBaseSurfaceRole class. More...
 
 ~LBaseSurfaceRole ()
 The LBaseSurfaceRole class destructor. More...
 
UInt32 roleId () const noexcept
 Role ID. More...
 
LSurfacesurface () const noexcept
 Returns the surface that has acquired the role provided in the constructor. More...
 
LResourceresource () const
 Returns the Wayland resource for this role given in the constructor. More...
 
LClientclient () const noexcept
 Client owner of the surface role. 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...
 
LObjectoperator= (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

- Public Types inherited from LBaseSurfaceRole
enum  CommitOrigin
 Commit origin. More...
 
- Public Types inherited from LFactoryObject
enum class  Type : Int32
 Base factory object types. More...
 
- Protected Member Functions inherited from LBaseSurfaceRole
virtual bool acceptCommitRequest (CommitOrigin origin)
 Asks if the surface commit should be processed. More...
 
virtual void handleSurfaceBufferAttach (wl_resource *buffer, Int32 x, Int32 y)
 Notifies a new surface buffer attachment. More...
 
virtual void handleSurfaceOffset (Int32 x, Int32 y)
 Notifies a surface buffer offset change. More...
 
virtual void handleParentCommit ()
 Notifies a parent surface commit. More...
 
virtual void handleParentMappingChange ()
 Notifies when the mapping state of the parent surface changes. More...
 
virtual void handleParentChange ()
 Notifies when the parent surface changes. More...
 
- 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...
 
- Protected Attributes inherited from LBaseSurfaceRole
LPoint m_rolePos
 Variable that stores the surface position given the role. More...
 

Detailed Description

Surface displayed during a session lock.

LSessionLockRole is used by session-locking clients to display arbitrary graphics while the session is locked.

When a client requests to lock a session (see LSessionLockManager::lockRequest()), it first creates an LSessionLockRole for each initialized output, sized to match each output's dimensions (the size is then automatically adjusted when output dimensions change).

All surfaces with this role start off unmapped, they only become mapped if permission to lock the session is granted to the client. Subsequently, they are unmapped again when the session is unlocked.

Note
While the session is locked, only surfaces created by the locking client LSessionLockManager::client() should be rendered and receive input events.

If the client terminates before unlocking the session (see LSessionLockManager::DeadLocked), the session must remain locked, and a fallback mechanism should be employed to authenticate the user, such as relaunching the same locking client.

Constructor & Destructor Documentation

◆ LSessionLockRole()

LSessionLockRole ( const void *  params)
noexcept

Constructor of the LSessionLockRole class.

Parameters
paramsInternal parameters provided in LCompositor::createObjectRequest().

◆ ~LSessionLockRole()

~LSessionLockRole ( )
default

Destructor of the LSessionLockRole class.

Invoked after LCompositor::onAnticipatedObjectDestruction().

Member Function Documentation

◆ exclusiveOutput()

LOutput* exclusiveOutput ( ) const
inlineoverridevirtual

The output the surface is assigned to.

Warning
It may return nullptr if the output is unplugged.

Reimplemented from LBaseSurfaceRole.

◆ rolePos()

virtual const LPoint& rolePos ( ) const
overridevirtual

Surface position.

The default implementation returns the same position as the output it is assigned to.

Default Implementation
{
return exclusiveOutput()->pos();
return surface()->pos();
}
LSurface * surface() const noexcept
Returns the surface that has acquired the role provided in the constructor.
Definition: LBaseSurfaceRole.h:117
const LPoint & pos() const noexcept
Gets the output position.
Definition: LOutput.cpp:359
virtual const LPoint & rolePos() const override
Surface position.
LOutput * exclusiveOutput() const override
The output the surface is assigned to.
Definition: LSessionLockRole.h:52
const LPoint & pos() const noexcept
Position given by the compositor.
Definition: LSurface.cpp:319
LPointTemplate< Int32 > LPoint
2D vector of 32 bits integers
Definition: LNamespaces.h:247

Implements LBaseSurfaceRole.