KWin
Loading...
Searching...
No Matches
Public Types | Signals | Public Member Functions | Friends | List of all members
KWin::LockedPointerV1Interface Class Reference

#include <pointerconstraints_v1.h>

Inheritance diagram for KWin::LockedPointerV1Interface:

Public Types

enum class  LifeTime : uint { OneShot = 1 , Persistent = 2 }
 

Signals

void aboutToBeDestroyed ()
 
void regionChanged ()
 
void cursorPositionHintChanged ()
 
void lockedChanged ()
 

Public Member Functions

 ~LockedPointerV1Interface () override
 
LifeTime lifeTime () const
 
QRegion region () const
 
QPointF cursorPositionHint () const
 
bool isLocked () const
 
void setLocked (bool locked)
 

Friends

class LockedPointerV1InterfacePrivate
 
class PointerConstraintsV1InterfacePrivate
 

Detailed Description

The LockedPointerV1Interface lets the client request to disable movements of the virtual pointer (i.e. the cursor), effectively locking the pointer to a position.

It is up to the compositor whether the lock gets activated. To activate it needs to use LockedPointerV1Interface::setLocked. The compositor needs to ensure that the SurfaceInterface has pointer focus and that the pointer is inside the LockedPointerV1Interface::region when it activates the lock.

While the lock is active the PointerInterface does no longer Q_EMIT pointer motion events, but still emits relative pointer motion events.

Definition at line 60 of file pointerconstraints_v1.h.

Member Enumeration Documentation

◆ LifeTime

enum class KWin::LockedPointerV1Interface::LifeTime : uint
strong
Enumerator
OneShot 
Persistent 

Definition at line 67 of file pointerconstraints_v1.h.

Constructor & Destructor Documentation

◆ ~LockedPointerV1Interface()

KWin::LockedPointerV1Interface::~LockedPointerV1Interface ( )
override

Definition at line 208 of file pointerconstraints_v1.cpp.

Member Function Documentation

◆ aboutToBeDestroyed

void KWin::LockedPointerV1Interface::aboutToBeDestroyed ( )
signal

This is signal is emitted when the locked pointer is about to be destroyed.

◆ cursorPositionHint()

QPointF KWin::LockedPointerV1Interface::cursorPositionHint ( ) const

Indicates where the mouse cursor should be positioned after it has been unlocked again. The compositor can warp the cursor at this moment to the position. For that it will not Q_EMIT any relative motion events. The hint is relative to the top-left corner of the surface the lock was applied to. Only non-negative x and y values are allowed. Otherwise the hint is invalid and should be ignored by the compositor.

In case the client never set the hint, an invalid one will be returned.

This function should be called when the compositor decides to break the lock or the client unbinds the resource. To set the position in this case the compositor should call this function when the aboutToBeUnbound signal has been emitted.

See also
cursorPositionHintChanged

Definition at line 222 of file pointerconstraints_v1.cpp.

◆ cursorPositionHintChanged

void KWin::LockedPointerV1Interface::cursorPositionHintChanged ( )
signal

Emitted whenever the cursor position hint changes. This happens when the parent SurfaceInterface gets committed

See also
cursorPositionHint

◆ isLocked()

bool KWin::LockedPointerV1Interface::isLocked ( ) const

Whether the Compositor set this pointer lock to be active.

See also
setLocked
lockedChanged

Definition at line 227 of file pointerconstraints_v1.cpp.

◆ lifeTime()

LockedPointerV1Interface::LifeTime KWin::LockedPointerV1Interface::lifeTime ( ) const

Definition at line 212 of file pointerconstraints_v1.cpp.

◆ lockedChanged

void KWin::LockedPointerV1Interface::lockedChanged ( )
signal

Emitted whenever the isLocked state changes.

See also
isLocked
setLocked

◆ region()

QRegion KWin::LockedPointerV1Interface::region ( ) const

The intersection of this region and the input region of the SurfaceInterface is used to determine where the pointer must be in order for the lock to activate. It is up to the compositor whether to warp the pointer or require some kind of user interaction for the lock to activate.

If the region is empty the SurfaceInterface input region is used.

See also
regionChanged
SurfaceInterface::input

Definition at line 217 of file pointerconstraints_v1.cpp.

◆ regionChanged

void KWin::LockedPointerV1Interface::regionChanged ( )
signal

Emitted whenever the region changes. This happens when the parent SurfaceInterface gets committed

See also
region

◆ setLocked()

void KWin::LockedPointerV1Interface::setLocked ( bool locked)

Activates or deactivates the lock.

A pointer lock can only be activated if the SurfaceInterface this LockedPointerV1Interface was created for has pointer focus and the pointer is inside the region.

Unlocking resets the cursor position hint.

Parameters
lockedWhether the lock should be active
See also
isLocked
lockedChanged

Definition at line 232 of file pointerconstraints_v1.cpp.

Friends And Related Symbol Documentation

◆ LockedPointerV1InterfacePrivate

friend class LockedPointerV1InterfacePrivate
friend

Definition at line 156 of file pointerconstraints_v1.h.

◆ PointerConstraintsV1InterfacePrivate

Definition at line 157 of file pointerconstraints_v1.h.


The documentation for this class was generated from the following files: