Pointer move event generated by the input backend.
{
bool pointerConstrained { false };
{
{
if (
focus()->pointerConstraintRegion().containsPoint(
cursor()->pos() - fpos))
}
if (
focus()->pointerConstraintEnabled())
{
{
if (
focus()->lockedPointerPosHint().x() >= 0.f)
else
{
};
}
}
else
{
};
}
pointerConstrained = true;
}
}
if (activeDND)
{
if (
seat()->dnd()->icon())
{
}
}
bool activeResizing { false };
for (LToplevelResizeSession *session :
seat()->toplevelResizeSessions())
{
{
activeResizing = true;
session->updateDragPoint(
cursor()->pos());
}
}
if (activeResizing)
return;
bool activeMoving { false };
for (LToplevelMoveSession *session :
seat()->toplevelMoveSessions())
{
{
activeMoving = true;
session->updateDragPoint(
cursor()->pos());
session->toplevel()->surface()->repaintOutputs();
if (session->toplevel()->maximized())
}
}
if (activeMoving)
return;
{
return;
}
if (surface)
{
return;
event.localPos =
cursor()->
pos() - surface->rolePos();
if (activeDND)
{
else
}
else
{
else
}
}
else
{
if (activeDND)
else
{
}
}
}
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:442
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
Type type() const noexcept
Retrieves the type of the event.
Definition LEvent.h:57
@ LSurface
Represents the LSurface class.
void setFocus(LSurface *surface)
Set keyboard focus.
Definition LKeyboard.cpp:276
constexpr T x() const noexcept
First component of the vector.
Definition LPoint.h:37
constexpr T y() const noexcept
Second component of the vector.
Definition LPoint.h:40
void setFocus(LSurface *surface, const LPoint &localPos) noexcept
Sets the pointer focus.
Definition LPointer.cpp:51
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:409
LSurface * surfaceAt(const LPoint &point)
Looks for a surface at the given position.
Definition LPointer.cpp:391
void setDraggingSurface(LSurface *surface) noexcept
Keep track of the surface pressed by the main pointer button.
Definition LPointer.cpp:348
void sendMoveEvent(const LPointerMoveEvent &event)
Sends a pointer move event to the currently focused surface.
Definition LPointer.cpp:104
LSurface * draggingSurface() const noexcept
Surface being actively pressed by the main pointer button.
Definition LPointer.cpp:353
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
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
@ 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
LCursor * cursor() noexcept
Gets the compositor's cursor.
Definition LCompositor.cpp:47
LPointTemplate< Float32 > LPointF
2D vector of 32 bits floats
Definition LNamespaces.h:257
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