Louvre v2.14.0-1
C++ library for Wayland compositors
Loading...
Searching...
No Matches
Public Member Functions | List of all members
LPointer Class Reference

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

#include <LPointer.h>

+ Inheritance diagram for LPointer:

Public Member Functions

 LPointer (const void *params) noexcept
 LPointer class constructor.
 
 ~LPointer ()
 LPointer class destructor.
 
LSurfacefocus () const noexcept
 Gets the focused surface.
 
void setFocus (LSurface *surface, const LPoint &localPos) noexcept
 Sets the pointer focus.
 
void setFocus (LSurface *surface) noexcept
 Sets the pointer focus.
 
void setDraggingSurface (LSurface *surface) noexcept
 Keep track of the surface pressed by the main pointer button.
 
LSurfacedraggingSurface () const noexcept
 Surface being actively pressed by the main pointer button.
 
LSurfacesurfaceAt (const LPoint &point)
 Looks for a surface at the given position.
 
const std::vector< LPointerButtonEvent::Button > & pressedKeys () const noexcept
 Vector of all currently pressed buttons.
 
bool isButtonPressed (LPointerButtonEvent::Button button) const noexcept
 Checks if a button is pressed.
 
void enableNaturalScrollingX (bool enabled) noexcept
 Toggles natural scrolling for the X axis.
 
void enableNaturalScrollingY (bool enabled) noexcept
 Toggles natural scrolling for the Y axis.
 
bool naturalScrollingXEnabled () const noexcept
 Checks if natural scrolling is enabled for the X axis.
 
bool naturalScrollingYEnabled () const noexcept
 Checks if natural scrolling is enabled for the Y axis.
 
- Public Member Functions inherited from LFactoryObject
Type factoryObjectType () const noexcept
 Gets the base factory object type.
 
- Public Member Functions inherited from LObject
 LObject (const LObject &) noexcept
 Copy constructor.
 
LObjectoperator= (const LObject &) noexcept
 Assignment operator (each object has its own individual LWeak reference count).
 
void setUserData (UIntPtr data) const noexcept
 Store an unsigned integer value/pointer.
 
UIntPtr userData () const noexcept
 Retrieves the stored unsigned integer value/pointer.
 

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.
 
void sendButtonEvent (const LPointerButtonEvent &event)
 Sends a pointer button event to the currently focused surface.
 
void sendScrollEvent (const LPointerScrollEvent &event)
 Sends a scroll event to the currently focused surface.
 
void sendSwipeBeginEvent (const LPointerSwipeBeginEvent &event)
 Sends a swipe begin gesture event to the currently focused surface.
 
void sendSwipeUpdateEvent (const LPointerSwipeUpdateEvent &event)
 Sends a swipe update gesture event to the currently focused surface.
 
void sendSwipeEndEvent (const LPointerSwipeEndEvent &event)
 Sends a swipe end gesture event to the currently focused surface.
 
void sendPinchBeginEvent (const LPointerPinchBeginEvent &event)
 Sends a pinch begin gesture event to the currently focused surface.
 
void sendPinchUpdateEvent (const LPointerPinchUpdateEvent &event)
 Sends a pinch update gesture event to the currently focused surface.
 
void sendPinchEndEvent (const LPointerPinchEndEvent &event)
 Sends a pinch end gesture event to the currently focused surface.
 
void sendHoldBeginEvent (const LPointerHoldBeginEvent &event)
 Sends a hold begin gesture event to the currently focused surface.
 
void sendHoldEndEvent (const LPointerHoldEndEvent &event)
 Sends a hold end gesture event to the currently focused surface.
 

Virtual Methods

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

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.
 
virtual ~LObject () noexcept
 Destructor of the LObject class.
 
void notifyDestruction () noexcept
 Notifies the object destruction.
 

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

{
// Update the cursor position
cursor()->move(event.delta().x(), event.delta().y());
bool pointerConstrained { false };
if (focus())
{
// 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 {
focus()->pointerConstraintRegion().closestPointFrom(cursor()->pos() - fpos)
};
cursor()->setPos(fpos + closestPoint);
}
}
else /* Confined */
{
const LPointF closestPoint {
focus()->pointerConstraintRegion().closestPointFrom(cursor()->pos() - fpos)
};
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:444
void setVisible(bool state) noexcept
Toggles the cursor visibility.
Definition LCursor.cpp:271
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
const LPointF & pos() const noexcept
Gets the current cursor position in compositor-global coordinates.
Definition LCursor.h:56
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
UInt32 ms() const noexcept
Retrieves the time the event was generated in milliseconds.
Definition LEvent.h:97
@ Touch
Touch event type.
@ LSurface
Represents the LSurface class.
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
Pointer movement event.
Definition LPointerMoveEvent.h:12
LPointF localPos
The surface or view local position where the pointer is positioned in surface coordinates.
Definition LPointerMoveEvent.h:98
const LPointF & delta() const noexcept
Gets the movement delta of the pointer.
Definition LPointerMoveEvent.h:58
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
@ Lock
Lock the pointer position somewhere inside pointerConstraintRegion().
Definition LSurface.h:157
@ Free
No pointer constraint, the pointer is free to move anywhere.
Definition LSurface.h:154
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.
Definition LSurface.cpp:113
@ Maximized
Maximized.
Definition LToplevelRole.h:93
Weak reference to an LObject.
Definition LWeak.h:25
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

{
const bool activeDND { seat()->dnd()->dragging() && seat()->dnd()->triggeringEvent().type() != LEvent::Type::Touch };
if (activeDND)
{
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;
}
{
return;
}
// Left button 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
Pointer button event.
Definition LPointerButtonEvent.h:12
@ Left
Left button.
Definition LPointerButtonEvent.h:25
State state() const noexcept
Gets the state of the button.
Definition LPointerButtonEvent.h:107
Button button() const noexcept
Gets the button code associated with the event.
Definition LPointerButtonEvent.h:91
@ 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

{
}
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
Pointer scroll event.
Definition LPointerScrollEvent.h:12

◆ pointerSwipeBeginEvent()

virtual void pointerSwipeBeginEvent ( const LPointerSwipeBeginEvent event)
virtual

Pointer swipe begin gesture event generated by the input backend.

Default Implementation

{
}
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
Pointer swipe begin gesture event.
Definition LPointerSwipeBeginEvent.h:11

◆ pointerSwipeUpdateEvent()

virtual void pointerSwipeUpdateEvent ( const LPointerSwipeUpdateEvent event)
virtual

Pointer swipe update gesture event generated by the input backend.

Default Implementation

{
}
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.
Pointer swipe update gesture event.
Definition LPointerSwipeUpdateEvent.h:12

◆ pointerSwipeEndEvent()

virtual void pointerSwipeEndEvent ( const LPointerSwipeEndEvent event)
virtual

Pointer swipe end gesture event generated by the input backend.

Default Implementation

{
}
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
Pointer swipe end gesture event.
Definition LPointerSwipeEndEvent.h:11

◆ pointerPinchBeginEvent()

virtual void pointerPinchBeginEvent ( const LPointerPinchBeginEvent event)
virtual

Pointer pinch begin gesture event generated by the input backend.

Default Implementation

{
}
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
Pointer pinch begin gesture event.
Definition LPointerPinchBeginEvent.h:11

◆ pointerPinchUpdateEvent()

virtual void pointerPinchUpdateEvent ( const LPointerPinchUpdateEvent event)
virtual

Pointer pinch update gesture event generated by the input backend.

Default Implementation

{
}
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
Pointer pinch update gesture event.
Definition LPointerPinchUpdateEvent.h:12

◆ pointerPinchEndEvent()

virtual void pointerPinchEndEvent ( const LPointerPinchEndEvent event)
virtual

Pointer pinch end gesture event generated by the input backend.

Default Implementation

{
}
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.
Pointer pinch end gesture event.
Definition LPointerPinchEndEvent.h:11

◆ pointerHoldBeginEvent()

virtual void pointerHoldBeginEvent ( const LPointerHoldBeginEvent event)
virtual

Pointer hold begin gesture event generated by the input backend.

Default Implementation

{
}
Pointer hold begin gesture event.
Definition LPointerHoldBeginEvent.h:11
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

{
}
Pointer hold end gesture event.
Definition LPointerHoldEndEvent.h:11
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);
}
Encapsulates parameters used in a set cursor request.
Definition LClientCursor.h:25
LClient * client() const noexcept
Returns the client owning the cursor.
Definition LClientCursor.h:71
virtual void setCursorRequest(const LClientCursor &clientCursor)
Set cursor request.