Let the window frame keep its cursor

The GUI sets the cursor of the hovered widget every frame, and over the
window that widget is usually the background with a plain arrow. The frame
sets its resize cursors on pointer motion, so the GUI replaced them on the
next frame: hovering a window edge did not show a resize cursor, it flickered
and stayed an arrow.

The window now reports whether the frame owns the cursor, and the GUI only
sets the hovered cursor when it does not. The GLFW backend claims it inside
the frame and gives it back in the client area together with the arrow, since
the GUI sets a cursor only while a widget is hovered.

Wayland keeps returning false, so the GUI behaves exactly as before there.
This commit is contained in:
alexei-zebra 2026-10-10 16:04:39 +03:00
parent 7126158d68
commit f13b75475f
No known key found for this signature in database
GPG key ID: D19D450AC3D9A80E
3 changed files with 22 additions and 1 deletions

View file

@ -52,6 +52,14 @@ public:
}
virtual void setCursor(CursorShape shape) = 0;
/// @brief Whether the engine drawn window frame owns the cursor now
///
/// The frame puts the resize cursors of its edges and of the bar, and the
/// GUI must not override them with the cursor of the hovered widget.
virtual bool ownsCursor() const {
return false;
}
virtual void setMode(WindowMode mode) = 0;
virtual WindowMode getMode() const = 0;