mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 09:04:30 +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:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user