1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 14:15:08 +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

@ -140,6 +140,17 @@ void GWindow::set_rect(const Rect& a_rect)
GEventLoop::current().post_message_to_server(request);
}
void GWindow::set_override_cursor(GStandardCursor cursor)
{
if (!m_window_id)
return;
WSAPI_ClientMessage request;
request.type = WSAPI_ClientMessage::Type::SetWindowOverrideCursor;
request.window_id = m_window_id;
request.cursor.cursor = (WSAPI_StandardCursor)cursor;
GEventLoop::current().post_message_to_server(request);
}
void GWindow::event(GEvent& event)
{
if (event.is_mouse_event()) {