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

Class for handling events generated by pointing devices. More...

+ Inheritance diagram for LPointer:

Public Member Functions

 LPointer (const void *params) noexcept
 LPointer class constructor. More...
 
 ~LPointer ()
 LPointer class destructor. More...
 
LSurfacefocus () const noexcept
 Gets the focused surface. More...
 
void setFocus (LSurface *surface, const LPoint &localPos) noexcept
 Sets the pointer focus. More...
 
void setFocus (LSurface *surface) noexcept
 Sets the pointer focus. More...
 
void setDraggingSurface (LSurface *surface) noexcept
 Keep track of the surface pressed by the main pointer button. More...
 
LSurfacedraggingSurface () const noexcept
 Surface being actively pressed by the main pointer button. More...
 
LSurfacesurfaceAt (const LPoint &point)
 Looks for a surface at the given position. More...
 
const std::vector< LPointerButtonEvent::Button > & pressedKeys () const noexcept
 Vector of all currently pressed buttons. More...
 
bool isButtonPressed (LPointerButtonEvent::Button button) const noexcept
 Checks if a button is pressed. More...
 
void enableNaturalScrollingX (bool enabled) noexcept
 Toggles natural scrolling for the X axis. More...
 
void enableNaturalScrollingY (bool enabled) noexcept
 Toggles natural scrolling for the Y axis. More...
 
bool naturalScrollingXEnabled () const noexcept
 Checks if natural scrolling is enabled for the X axis. More...
 
bool naturalScrollingYEnabled () const noexcept
 Checks if natural scrolling is enabled for the Y axis. 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...
 

Client Events

These methods allow you to send pointer events to clients.

Note
Pointer events are sent to the currently focused surface set with setFocus(). If no surface has focus, calling these methods has no effect.
void sendMoveEvent (const LPointerMoveEvent &event)
 Sends a pointer move event to the currently focused surface. More...
 
void sendButtonEvent (const LPointerButtonEvent &event)
 Sends a pointer button event to the currently focused surface. More...
 
void sendScrollEvent (const LPointerScrollEvent &event)
 Sends a scroll event to the currently focused surface. More...
 
void sendSwipeBeginEvent (const LPointerSwipeBeginEvent &event)
 Sends a swipe begin gesture event to the currently focused surface. More...
 
void sendSwipeUpdateEvent (const LPointerSwipeUpdateEvent &event)
 Sends a swipe update gesture event to the currently focused surface. More...
 
void sendSwipeEndEvent (const LPointerSwipeEndEvent &event)
 Sends a swipe end gesture event to the currently focused surface. More...
 
void sendPinchBeginEvent (const LPointerPinchBeginEvent &event)
 Sends a pinch begin gesture event to the currently focused surface. More...
 
void sendPinchUpdateEvent (const LPointerPinchUpdateEvent &event)
 Sends a pinch update gesture event to the currently focused surface. More...
 
void sendPinchEndEvent (const LPointerPinchEndEvent &event)
 Sends a pinch end gesture event to the currently focused surface. More...
 
void sendHoldBeginEvent (const LPointerHoldBeginEvent &event)
 Sends a hold begin gesture event to the currently focused surface. More...
 
void sendHoldEndEvent (const LPointerHoldEndEvent &event)
 Sends a hold end gesture event to the currently focused surface. More...
 

Virtual Methods

virtual void pointerMoveEvent (const LPointerMoveEvent &event)
 Pointer move event generated by the input backend. More...
 
virtual void pointerButtonEvent (const LPointerButtonEvent &event)
 Pointer button event generated by the input backend. More...
 
virtual void pointerScrollEvent (const LPointerScrollEvent &event)
 Pointer scroll event generated by the input backend. More...
 
virtual void pointerSwipeBeginEvent (const LPointerSwipeBeginEvent &event)
 Pointer swipe begin gesture event generated by the input backend. More...
 
virtual void pointerSwipeUpdateEvent (const LPointerSwipeUpdateEvent &event)
 Pointer swipe update gesture event generated by the input backend. More...
 
virtual void pointerSwipeEndEvent (const LPointerSwipeEndEvent &event)
 Pointer swipe end gesture event generated by the input backend. More...
 
virtual void pointerPinchBeginEvent (const LPointerPinchBeginEvent &event)
 Pointer pinch begin gesture event generated by the input backend. More...
 
virtual void pointerPinchUpdateEvent (const LPointerPinchUpdateEvent &event)
 Pointer pinch update gesture event generated by the input backend. More...
 
virtual void pointerPinchEndEvent (const LPointerPinchEndEvent &event)
 Pointer pinch end gesture event generated by the input backend. More...
 
virtual void pointerHoldBeginEvent (const LPointerHoldBeginEvent &event)
 Pointer hold begin gesture event generated by the input backend. More...
 
virtual void pointerHoldEndEvent (const LPointerHoldEndEvent &event)
 Pointer hold end gesture event generated by the input backend. More...
 
virtual void setCursorRequest (const LClientCursor &clientCursor)
 Set cursor request. More...
 

Additional Inherited Members

- Public Types inherited from LFactoryObject
enum class  Type : Int32
 Base factory object types. 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...
 

Detailed Description

Class for handling events generated by pointing devices.

The LPointer class allows you to listen to input events generated by devices such as a mouse or touchpad and redirect them to client surfaces. There is a single instance of LPointer, which can be accessed through LSeat::pointer().

Wayland Events

To send pointer events to clients, you must first assign focus to a surface using one of the setFocus() variants.
Subsequently, all pointer events sent with any of the sendXXXEvent() methods are directed to the currently focused surface.

Constructor & Destructor Documentation

◆ LPointer()

LPointer ( const void *  params)
noexcept

LPointer class constructor.

There is a single instance of LPointer, which can be accessed from LSeat::pointer().

Parameters
paramsInternal library parameters provided in the LCompositor::createObjectRequest() virtual constructor.

◆ ~LPointer()

~LPointer ( )

LPointer class destructor.

Invoked after LCompositor::onAnticipatedObjectDestruction().

Member Function Documentation

◆ focus()

LSurface * focus ( ) const
noexcept

Gets the focused surface.

This method returns the surface that has been assigned pointer focus using setFocus().

Note
Only the focused surface can receive pointer events.
Returns
The focused surface, or nullptr if no surface has pointer focus.

◆ setFocus() [1/2]

void setFocus ( LSurface surface,
const LPoint localPos 
)
noexcept

Sets the pointer focus.

This method assigns the pointer focus to the specified surface at the given local surface position within the surface.

If another surface already has pointer focus, it will lose it.

Parameters
surfaceSurface to which the pointer focus will be assigned, or nullptr to remove focus from all surfaces.
localPosLocal position within the surface where the pointer enters.

◆ setFocus() [2/2]

void setFocus ( LSurface surface)
noexcept

Sets the pointer focus.

Sets the pointer focus to the provided surface based on the current LCursor position.

Note
This method internally transforms the LCursor position to the local coordinates of the focused surface, taking into account the surface's role position.
Parameters
surfaceThe surface to which you want to assign the pointer focus or nullptr to remove focus from all surfaces.

◆ setDraggingSurface()

void setDraggingSurface ( LSurface surface)
noexcept

Keep track of the surface pressed by the main pointer button.

This is just a utility used by the default LPointer implementation to ensure that pointer focus remains on a surface while it's being actively pressed by the left pointer button, for example, during text selection, even if the pointer moves outside the surface boundaries.

Note
This is unrelated to drag & drop sessions.
Parameters
surfaceThe surface being pressed or nullptr to unset.
See also
draggingSurface()

◆ draggingSurface()

LSurface * draggingSurface ( ) const
noexcept

Surface being actively pressed by the main pointer button.

This method returns the surface that is currently being actively pressed by the main pointer button.

Returns
The surface being pressed or nullptr.
See also
setDraggingSurface()

◆ surfaceAt()

LSurface * surfaceAt ( const LPoint point)

Looks for a surface at the given position.

This method looks for the first mapped surface that contains the point given point.
It takes into account the surfaces rolePos(), size(), inputRegion() and the reverse order given by the LCompositor::surfaces() list.

Note
Some surface roles do not have an input region such as LCursorRole or LDNDIconRole so these surfaces are always ignored.
Parameters
pointPoint in compositor-global coordinates.
Returns
Returns the first surface that contains the point or nullptr if no surface is found.

◆ pressedKeys()

const std::vector< LPointerButtonEvent::Button > & pressedKeys ( ) const
noexcept

Vector of all currently pressed buttons.

See also
isButtonPressed()

◆ isButtonPressed()

bool isButtonPressed ( LPointerButtonEvent::Button  button) const
noexcept

Checks if a button is pressed.

See also
pressedKeys()

◆ enableNaturalScrollingX()

void enableNaturalScrollingX ( bool  enabled)
noexcept

Toggles natural scrolling for the X axis.

Note
This affects the way scroll events are sent to clients via sendPointerScrollEvent(), but not the events received from the input backend through pointerScrollEvent().

Disabled by default. See naturalScrollingXEnabled().

Parameters
enabledSet to true to enable natural scrolling, or false to disable it.

◆ enableNaturalScrollingY()

void enableNaturalScrollingY ( bool  enabled)
noexcept

Toggles natural scrolling for the Y axis.

Note
This affects the way scroll events are sent to clients via sendPointerScrollEvent(), but not the events received from the input backend through pointerScrollEvent().

Disabled by default. See naturalScrollingYEnabled().

Parameters
enabledSet to true to enable natural scrolling, or false to disable it.

◆ naturalScrollingXEnabled()

bool naturalScrollingXEnabled ( ) const
noexcept

Checks if natural scrolling is enabled for the X axis.

See also
enableNaturalScrollingX().

◆ naturalScrollingYEnabled()

bool naturalScrollingYEnabled ( ) const
noexcept

Checks if natural scrolling is enabled for the Y axis.

See also
enableNaturalScrollingY().

◆ sendMoveEvent()

void sendMoveEvent ( const LPointerMoveEvent event)

Sends a pointer move event to the currently focused surface.

Note
To specify the position within the surface modify the mutable LPointerMoveEvent::localPos property.

◆ sendButtonEvent()

void sendButtonEvent ( const LPointerButtonEvent event)

Sends a pointer button event to the currently focused surface.

◆ sendScrollEvent()

void sendScrollEvent ( const LPointerScrollEvent event)

Sends a scroll event to the currently focused surface.

See also
enableNaturalScrollingX() and enableNaturalScrollingY().

◆ sendSwipeBeginEvent()

void sendSwipeBeginEvent ( const LPointerSwipeBeginEvent event)

Sends a swipe begin gesture event to the currently focused surface.

◆ sendSwipeUpdateEvent()

void sendSwipeUpdateEvent ( const LPointerSwipeUpdateEvent event)

Sends a swipe update gesture event to the currently focused surface.

Note
A sendSwipeBeginEvent() should have been sent before, otherwise this is a no-op.

◆ sendSwipeEndEvent()

void sendSwipeEndEvent ( const LPointerSwipeEndEvent event)

Sends a swipe end gesture event to the currently focused surface.

Note
A sendSwipeBeginEvent() should have been sent before, otherwise this is a no-op.
This event is automatically sent if a sendSwipeBeginEvent() was sent and the surface lost focus.

◆ sendPinchBeginEvent()

void sendPinchBeginEvent ( const LPointerPinchBeginEvent event)

Sends a pinch begin gesture event to the currently focused surface.

◆ sendPinchUpdateEvent()

void sendPinchUpdateEvent ( const LPointerPinchUpdateEvent event)

Sends a pinch update gesture event to the currently focused surface.

Note
A sendPinchBeginEvent() should have been sent before, otherwise this is a no-op.

◆ sendPinchEndEvent()

void sendPinchEndEvent ( const LPointerPinchEndEvent event)

Sends a pinch end gesture event to the currently focused surface.

Note
A sendPinchBeginEvent() should have been sent before, otherwise this is a no-op.
This event is automatically sent if a sendPinchBeginEvent() was sent and the surface lost focus.

◆ sendHoldBeginEvent()

void sendHoldBeginEvent ( const LPointerHoldBeginEvent event)

Sends a hold begin gesture event to the currently focused surface.

◆ sendHoldEndEvent()

void sendHoldEndEvent ( const LPointerHoldEndEvent event)

Sends a hold end gesture event to the currently focused surface.

Note
A sendHoldBeginEvent() should have been sent before, otherwise this is a no-op.
This event is automatically sent if a sendHoldBeginEvent() was sent and the surface lost focus.

◆ pointerMoveEvent()

virtual void pointerMoveEvent ( const LPointerMoveEvent event)
virtual

Pointer move event generated by the input backend.

Default Implementation

void LPointer::pointerMoveEvent(const LPointerMoveEvent &event)
{
// Update the cursor position
cursor()->move(event.delta().x(), event.delta().y());
bool pointerConstrained { false };
if (focus())
{
LPointF fpos { focus()->rolePos() };
// Attempt to enable the pointer constraint mode if the cursor is within the constrained region.
if (focus()->pointerConstraintMode() != LSurface::PointerConstraintMode::Free)
{
if (focus()->pointerConstraintRegion().containsPoint(cursor()->pos() - fpos))
}
if (focus()->pointerConstraintEnabled())
{
if (focus()->pointerConstraintMode() == LSurface::PointerConstraintMode::Lock)
{
if (focus()->lockedPointerPosHint().x() >= 0.f)
cursor()->setPos(fpos + focus()->lockedPointerPosHint());
else
{
cursor()->move(-event.delta().x(), -event.delta().y());
const LPointF closestPoint {
};
cursor()->setPos(fpos + closestPoint);
}
}
else /* Confined */
{
const LPointF closestPoint {
};
cursor()->setPos(fpos + closestPoint);
}
pointerConstrained = true;
}
}
// Schedule repaint on outputs that intersect with the cursor where hardware composition is not supported.
const bool sessionLocked { compositor()->sessionLockManager()->state() != LSessionLockManager::Unlocked };
const bool activeDND { seat()->dnd()->dragging() && seat()->dnd()->triggeringEvent().type() != LEvent::Type::Touch };
if (activeDND)
{
if (seat()->dnd()->icon())
{
seat()->dnd()->icon()->surface()->setPos(cursor()->pos());
cursor()->setCursor(seat()->dnd()->icon()->surface()->client()->lastCursorRequest());
}
seat()->keyboard()->setFocus(nullptr);
setFocus(nullptr);
}
bool activeResizing { false };
for (LToplevelResizeSession *session : seat()->toplevelResizeSessions())
{
if (session->triggeringEvent().type() != LEvent::Type::Touch)
{
activeResizing = true;
session->updateDragPoint(cursor()->pos());
}
}
if (activeResizing)
return;
bool activeMoving { false };
for (LToplevelMoveSession *session : seat()->toplevelMoveSessions())
{
if (session->triggeringEvent().type() != LEvent::Type::Touch)
{
activeMoving = true;
session->updateDragPoint(cursor()->pos());
session->toplevel()->surface()->repaintOutputs();
if (session->toplevel()->maximized())
session->toplevel()->configureState(session->toplevel()->pendingConfiguration().state &~ LToplevelRole::Maximized);
}
}
if (activeMoving)
return;
// If a surface had the left pointer button held down
{
event.localPos = cursor()->pos() - draggingSurface()->rolePos();
sendMoveEvent(event);
return;
}
// Find the first surface under the cursor
LSurface *surface { pointerConstrained ? focus() : surfaceAt(cursor()->pos()) };
if (surface)
{
if (sessionLocked && surface->client() != sessionLockManager()->client())
return;
event.localPos = cursor()->pos() - surface->rolePos();
if (activeDND)
{
if (seat()->dnd()->focus() == surface)
seat()->dnd()->sendMoveEvent(event.localPos, event.ms());
else
seat()->dnd()->setFocus(surface, event.localPos);
}
else
{
if (focus() == surface)
sendMoveEvent(event);
else
setFocus(surface, event.localPos);
}
cursor()->setCursor(surface->client()->lastCursorRequest());
}
else
{
if (activeDND)
seat()->dnd()->setFocus(nullptr, LPointF());
else
{
setFocus(nullptr);
cursor()->setVisible(true);
}
}
}
LSurface * surface() const noexcept
Returns the surface that has acquired the role provided in the constructor.
Definition: LBaseSurfaceRole.h:117
LSessionLockManager * sessionLockManager() const noexcept
Provides access to the session lock manager.
Definition: LCompositor.cpp:443
void setVisible(bool state) noexcept
Toggles the cursor visibility.
Definition: LCursor.cpp:271
const LPointF & pos() const noexcept
Gets the current cursor position in compositor-global coordinates.
Definition: LCursor.h:56
void setCursor(const LClientCursor &clientCursor) noexcept
Assigns an LClientCursor.
Definition: LCursor.cpp:186
void setPos(const LPointF &pos) noexcept
Sets the cursor position.
Definition: LCursor.cpp:222
void repaintOutputs(bool nonHardwareOnly=true) noexcept
Repaint intersected outputs.
Definition: LCursor.cpp:292
void move(Float32 dx, Float32 dy) noexcept
Moves the cursor.
Definition: LCursor.cpp:212
void useDefault() noexcept
Restores the default cursor.
Definition: LCursor.cpp:130
void setFocus(LSurface *surface, const LPointF &localPos) noexcept
Set DND focus.
Definition: LDND.cpp:28
LDNDIconRole * icon() const noexcept
Drag & drop session icon.
Definition: LDND.cpp:118
const LEvent & triggeringEvent() const noexcept
Indicates which input event triggered the drag & drop session.
Definition: LDND.cpp:113
void sendMoveEvent(const LPointF &localPos, UInt32 ms) noexcept
Send a DND move event.
Definition: LDND.cpp:102
bool dragging() const noexcept
Check if a drag & drop session is currently in progress.
Definition: LDND.cpp:139
@ Touch
Touch event type.
Type type() const noexcept
Retrieves the type of the event.
Definition: LEvent.h:57
void setFocus(LSurface *surface)
Set keyboard focus.
Definition: LKeyboard.cpp:276
void setFocus(LSurface *surface, const LPoint &localPos) noexcept
Sets the pointer focus.
Definition: LPointer.cpp:47
virtual void pointerMoveEvent(const LPointerMoveEvent &event)
Pointer move event generated by the input backend.
LSurface * focus() const noexcept
Gets the focused surface.
Definition: LPointer.cpp:400
LSurface * surfaceAt(const LPoint &point)
Looks for a surface at the given position.
Definition: LPointer.cpp:382
void setDraggingSurface(LSurface *surface) noexcept
Keep track of the surface pressed by the main pointer button.
Definition: LPointer.cpp:339
void sendMoveEvent(const LPointerMoveEvent &event)
Sends a pointer move event to the currently focused surface.
Definition: LPointer.cpp:95
LSurface * draggingSurface() const noexcept
Surface being actively pressed by the main pointer button.
Definition: LPointer.cpp:344
LPointF closestPointFrom(const LPointF &point, Float32 padding=0.f) const noexcept
Returns the point within the region closest to the given point.
Definition: LRegion.cpp:201
LDND * dnd() const noexcept
Access to the drag & drop session manager.
Definition: LSeat.h:197
LKeyboard * keyboard() const noexcept
Access to keyboard events.
Definition: LSeat.h:179
State state() const noexcept
Gets the current state of the session.
Definition: LSessionLockManager.h:65
@ Unlocked
Definition: LSessionLockManager.h:27
void repaintOutputs() noexcept
Repaints the intersected outputs.
Definition: LSurface.cpp:196
const LRegion & pointerConstraintRegion() const noexcept
Region within the surface where the pointer should be locked or confined if pointer constraint is ena...
Definition: LSurface.cpp:267
void enablePointerConstraint(bool enabled)
Notifies the client if the pointer is constrained.
Definition: LSurface.cpp:272
const LPoint & rolePos() const
Role position.
Definition: LSurface.cpp:326
void setPos(const LPoint &newPos) noexcept
Assigns the position.
@ Maximized
Maximized.
Definition: LToplevelRole.h:93
LCursor * cursor() noexcept
Gets the compositor's cursor.
Definition: LCompositor.cpp:47
LPointTemplate< Float32 > LPointF
2D vector of 32 bits floats
Definition: LNamespaces.h:256
LCompositor * compositor() noexcept
Gets the static LCompositor instance.
Definition: LCompositor.cpp:37
LSessionLockManager * sessionLockManager() noexcept
Gets the compositor's session lock manager.
Definition: LCompositor.cpp:52
LSeat * seat() noexcept
Gets the compositor's seat.
Definition: LCompositor.cpp:42

◆ pointerButtonEvent()

virtual void pointerButtonEvent ( const LPointerButtonEvent event)
virtual

Pointer button event generated by the input backend.

Default Implementation

void LPointer::pointerButtonEvent(const LPointerButtonEvent &event)
{
const bool sessionLocked { sessionLockManager()->state() != LSessionLockManager::Unlocked };
const bool activeDND { seat()->dnd()->dragging() && seat()->dnd()->triggeringEvent().type() != LEvent::Type::Touch };
if (activeDND)
{
if (event.state() == LPointerButtonEvent::Released &&
event.button() == LPointerButtonEvent::Left)
seat()->dnd()->drop();
seat()->keyboard()->setFocus(nullptr);
setFocus(nullptr);
return;
}
if (!focus())
{
LSurface *surface { surfaceAt(cursor()->pos()) };
if (surface)
{
if (sessionLocked && surface->client() != sessionLockManager()->client())
return;
cursor()->setCursor(surface->client()->lastCursorRequest());
seat()->keyboard()->setFocus(surface);
setFocus(surface);
if (!surface->popup() && !surface->isPopupSubchild())
}
else
{
seat()->keyboard()->setFocus(nullptr);
}
return;
}
if (event.button() != LPointerButtonEvent::Left)
{
return;
}
// Left button pressed
if (event.state() == LPointerButtonEvent::Pressed)
{
// Keep a ref to continue sending it events after the cursor
// leaves, if the left button remains pressed
if (!seat()->keyboard()->focus() || !focus()->isSubchildOf(seat()->keyboard()->focus()))
{
// Pointer focus may have changed within LKeyboard::focusChanged()
if (!focus())
return;
}
if (focus()->toplevel() && !focus()->toplevel()->activated())
focus()->toplevel()->configureState(focus()->toplevel()->pendingConfiguration().state | LToplevelRole::Activated);
if (!focus()->popup() && !focus()->isPopupSubchild())
if (!focus() || focus() == compositor()->surfaces().back())
return;
if (focus()->parent())
else
focus()->raise();
}
// Left button released
else
{
// Stop pointer toplevel resizing sessions
for (auto it = seat()->toplevelResizeSessions().begin(); it != seat()->toplevelResizeSessions().end();)
{
if ((*it)->triggeringEvent().type() != LEvent::Type::Touch)
it = (*it)->stop();
else
it++;
}
// Stop pointer toplevel moving sessions
for (auto it = seat()->toplevelMoveSessions().begin(); it != seat()->toplevelMoveSessions().end();)
{
if ((*it)->triggeringEvent().type() != LEvent::Type::Touch)
it = (*it)->stop();
else
it++;
}
// We stop sending events to the surface on which the left button was being held down
if (!focus()->pointerConstraintEnabled() && !focus()->inputRegion().containsPoint(cursor()->pos() - focus()->rolePos()))
{
setFocus(nullptr);
cursor()->setVisible(true);
}
}
}
void drop() noexcept
Drop the data offer.
Definition: LDND.cpp:160
@ Left
Left button.
Definition: LPointerButtonEvent.h:25
@ Pressed
Button pressed.
Definition: LPointerButtonEvent.h:60
@ Released
Button released.
Definition: LPointerButtonEvent.h:57
void sendButtonEvent(const LPointerButtonEvent &event)
Sends a pointer button event to the currently focused surface.
Definition: LPointer.cpp:120
virtual void pointerButtonEvent(const LPointerButtonEvent &event)
Pointer button event generated by the input backend.
void dismissPopups() noexcept
Close all popups.
Definition: LSeat.cpp:121
const std::vector< LToplevelResizeSession * > & toplevelResizeSessions() const noexcept
Active LToplevelRole resize sessions.
Definition: LSeat.cpp:111
const std::vector< LToplevelMoveSession * > & toplevelMoveSessions() const noexcept
Active LToplevelRole move sessions.
Definition: LSeat.cpp:116
LSurface * topmostParent() const noexcept
Topmost parent of the surface.
Definition: LSurface.cpp:494
LToplevelRole * toplevel() const noexcept
Toplevel role.
Definition: LSurface.cpp:60
void raise()
Raises the surface within its current layer.
Definition: LSurface.cpp:560
void configureState(LBitset< State > flags) noexcept
Configure the toplevel state.
Definition: LToplevelRole.h:314
@ Activated
Activated (its decorations stand out from others)
Definition: LToplevelRole.h:109

◆ pointerScrollEvent()

virtual void pointerScrollEvent ( const LPointerScrollEvent event)
virtual

Pointer scroll event generated by the input backend.

Default Implementation

void LPointer::pointerScrollEvent(const LPointerScrollEvent &event)
{
}
virtual void pointerScrollEvent(const LPointerScrollEvent &event)
Pointer scroll event generated by the input backend.
void sendScrollEvent(const LPointerScrollEvent &event)
Sends a scroll event to the currently focused surface.
Definition: LPointer.cpp:135

◆ pointerSwipeBeginEvent()

virtual void pointerSwipeBeginEvent ( const LPointerSwipeBeginEvent event)
virtual

Pointer swipe begin gesture event generated by the input backend.

Default Implementation

void LPointer::pointerSwipeBeginEvent(const LPointerSwipeBeginEvent &event)
{
}
virtual void pointerSwipeBeginEvent(const LPointerSwipeBeginEvent &event)
Pointer swipe begin gesture event generated by the input backend.
void sendSwipeBeginEvent(const LPointerSwipeBeginEvent &event)
Sends a swipe begin gesture event to the currently focused surface.
Definition: LPointer.cpp:224

◆ pointerSwipeUpdateEvent()

virtual void pointerSwipeUpdateEvent ( const LPointerSwipeUpdateEvent event)
virtual

Pointer swipe update gesture event generated by the input backend.

Default Implementation

void LPointer::pointerSwipeUpdateEvent(const LPointerSwipeUpdateEvent &event)
{
}
void sendSwipeUpdateEvent(const LPointerSwipeUpdateEvent &event)
Sends a swipe update gesture event to the currently focused surface.
Definition: LPointer.cpp:242
virtual void pointerSwipeUpdateEvent(const LPointerSwipeUpdateEvent &event)
Pointer swipe update gesture event generated by the input backend.

◆ pointerSwipeEndEvent()

virtual void pointerSwipeEndEvent ( const LPointerSwipeEndEvent event)
virtual

Pointer swipe end gesture event generated by the input backend.

Default Implementation

void LPointer::pointerSwipeEndEvent(const LPointerSwipeEndEvent &event)
{
}
virtual void pointerSwipeEndEvent(const LPointerSwipeEndEvent &event)
Pointer swipe end gesture event generated by the input backend.
void sendSwipeEndEvent(const LPointerSwipeEndEvent &event)
Sends a swipe end gesture event to the currently focused surface.
Definition: LPointer.cpp:253

◆ pointerPinchBeginEvent()

virtual void pointerPinchBeginEvent ( const LPointerPinchBeginEvent event)
virtual

Pointer pinch begin gesture event generated by the input backend.

Default Implementation

void LPointer::pointerPinchBeginEvent(const LPointerPinchBeginEvent &event)
{
}
virtual void pointerPinchBeginEvent(const LPointerPinchBeginEvent &event)
Pointer pinch begin gesture event generated by the input backend.
void sendPinchBeginEvent(const LPointerPinchBeginEvent &event)
Sends a pinch begin gesture event to the currently focused surface.
Definition: LPointer.cpp:266

◆ pointerPinchUpdateEvent()

virtual void pointerPinchUpdateEvent ( const LPointerPinchUpdateEvent event)
virtual

Pointer pinch update gesture event generated by the input backend.

Default Implementation

void LPointer::pointerPinchUpdateEvent(const LPointerPinchUpdateEvent &event)
{
}
virtual void pointerPinchUpdateEvent(const LPointerPinchUpdateEvent &event)
Pointer pinch update gesture event generated by the input backend.
void sendPinchUpdateEvent(const LPointerPinchUpdateEvent &event)
Sends a pinch update gesture event to the currently focused surface.
Definition: LPointer.cpp:284

◆ pointerPinchEndEvent()

virtual void pointerPinchEndEvent ( const LPointerPinchEndEvent event)
virtual

Pointer pinch end gesture event generated by the input backend.

Default Implementation

void LPointer::pointerPinchEndEvent(const LPointerPinchEndEvent &event)
{
}
void sendPinchEndEvent(const LPointerPinchEndEvent &event)
Sends a pinch end gesture event to the currently focused surface.
Definition: LPointer.cpp:295
virtual void pointerPinchEndEvent(const LPointerPinchEndEvent &event)
Pointer pinch end gesture event generated by the input backend.

◆ pointerHoldBeginEvent()

virtual void pointerHoldBeginEvent ( const LPointerHoldBeginEvent event)
virtual

Pointer hold begin gesture event generated by the input backend.

Default Implementation

void LPointer::pointerHoldBeginEvent(const LPointerHoldBeginEvent &event)
{
}
void sendHoldBeginEvent(const LPointerHoldBeginEvent &event)
Sends a hold begin gesture event to the currently focused surface.
Definition: LPointer.cpp:308
virtual void pointerHoldBeginEvent(const LPointerHoldBeginEvent &event)
Pointer hold begin gesture event generated by the input backend.

◆ pointerHoldEndEvent()

virtual void pointerHoldEndEvent ( const LPointerHoldEndEvent event)
virtual

Pointer hold end gesture event generated by the input backend.

Default Implementation

void LPointer::pointerHoldEndEvent(const LPointerHoldEndEvent &event)
{
}
void sendHoldEndEvent(const LPointerHoldEndEvent &event)
Sends a hold end gesture event to the currently focused surface.
Definition: LPointer.cpp:326
virtual void pointerHoldEndEvent(const LPointerHoldEndEvent &event)
Pointer hold end gesture event generated by the input backend.

◆ setCursorRequest()

virtual void setCursorRequest ( const LClientCursor clientCursor)
virtual

Set cursor request.

Triggered when a client requests to set the cursor texture, hotspot or hide it.

See also
LCursor::setCursor()
LClient::lastCursorRequest().

Default Implementation

void LPointer::setCursorRequest(const LClientCursor &clientCursor)
{
/* During a non-touch drag & drop session, the source client typically updates the cursor to
* reflect the DND action (e.g., copy, move, not supported, etc.)
*/
if (seat()->dnd()->dragging() && seat()->dnd()->triggeringEvent().type() != LEvent::Type::Touch)
{
if (seat()->dnd()->origin()->client() == clientCursor.client())
cursor()->setCursor(clientCursor);
return;
}
/* Allow the client to set the cursor only if one of its surfaces has pointer focus */
if (focus() && focus()->client() == clientCursor.client())
cursor()->setCursor(clientCursor);
}
virtual void setCursorRequest(const LClientCursor &clientCursor)
Set cursor request.
LClient * client() const noexcept
Client owner of the surface.
Definition: LSurface.cpp:476