1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:27:35 +00:00

WindowServer: Add support for per-window override cursors.

Use this to implement automatic switching to an I-beam cursor when hovering
over a GTextEditor. :^)
This commit is contained in:
Andreas Kling 2019-03-31 23:52:02 +02:00
parent 42c95959a8
commit dcf6726487
13 changed files with 110 additions and 0 deletions

View file

@ -8,6 +8,7 @@
#include <WindowServer/WSWindowType.h>
class WSClientConnection;
class WSCursor;
class WSMenu;
class WSMouseEvent;
@ -100,6 +101,9 @@ public:
const GraphicsBitmap& icon() const { return *m_icon; }
void set_icon(Retained<GraphicsBitmap>&& icon) { m_icon = move(icon); }
const WSCursor* override_cursor() const { return m_override_cursor.ptr(); }
void set_override_cursor(RetainPtr<WSCursor>&& cursor) { m_override_cursor = move(cursor); }
// For InlineLinkedList.
// FIXME: Maybe make a ListHashSet and then WSWindowManager can just use that.
WSWindow* m_next { nullptr };
@ -128,4 +132,5 @@ private:
Size m_size_increment;
Size m_base_size;
Retained<GraphicsBitmap> m_icon;
RetainPtr<WSCursor> m_override_cursor;
};