KWin
|
#include <pointerconstraints_v1.h>
Public Types | |
enum class | LifeTime : uint { OneShot = 1 , Persistent = 2 } |
Signals | |
void | regionChanged () |
void | confinedChanged () |
Public Member Functions | |
~ConfinedPointerV1Interface () override | |
LifeTime | lifeTime () const |
QRegion | region () const |
bool | isConfined () const |
void | setConfined (bool confined) |
Friends | |
class | ConfinedPointerV1InterfacePrivate |
class | PointerConstraintsV1InterfacePrivate |
The ConfinedPointerV1Interface gets installed on a SurfaceInterface. The confinement indicates that the SurfaceInterface wants to confine the pointer to a region of the SurfaceInterface.
It is up to the compositor whether the confinement gets activated. To activate it needs to use ConfinedPointerV1Interface::setConfined
. The compositor needs to ensure that the SurfaceInterface has pointer focus and that the pointer is inside the ConfinedPointerV1Interface::region
when it activates the confinement.
From client side the confinement gets deactivated by destroying the ConfinedPointerV1Interface. From compositor side the confinement can be deactivated by setting ConfinedPointerV1Interface::setConfined
to false
.
Definition at line 176 of file pointerconstraints_v1.h.
|
strong |
Enumerator | |
---|---|
OneShot | |
Persistent |
Definition at line 183 of file pointerconstraints_v1.h.
|
override |
Definition at line 314 of file pointerconstraints_v1.cpp.
|
signal |
Emitted whenever the isConfined
state changes.
bool KWin::ConfinedPointerV1Interface::isConfined | ( | ) | const |
Whether the Compositor set this pointer confinement to be active.
Definition at line 328 of file pointerconstraints_v1.cpp.
ConfinedPointerV1Interface::LifeTime KWin::ConfinedPointerV1Interface::lifeTime | ( | ) | const |
Definition at line 318 of file pointerconstraints_v1.cpp.
QRegion KWin::ConfinedPointerV1Interface::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 confinement to activate. It is up to the compositor whether to warp the pointer or require some kind of user interaction for the confinement to activate.
If the region is empty the SurfaceInterface input region is used.
Definition at line 323 of file pointerconstraints_v1.cpp.
|
signal |
Emitted whenever the region changes. This happens when the parent SurfaceInterface gets committed
void KWin::ConfinedPointerV1Interface::setConfined | ( | bool | confined | ) |
Activates or deactivates the confinement.
A pointer confinement can only be activated if the SurfaceInterface this ConfinedPointerV1Interface was created for has pointer focus and the pointer is inside the region
.
confined | Whether the confinement should be active |
Definition at line 333 of file pointerconstraints_v1.cpp.
|
friend |
Definition at line 241 of file pointerconstraints_v1.h.
|
friend |
Definition at line 242 of file pointerconstraints_v1.h.