summaryrefslogtreecommitdiff
path: root/LibGUI/GWindow.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-31 23:52:02 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-03-31 23:52:02 +0200
commitdcf6726487d17f5fb36803e3b8d74ed75ee4fa53 (patch)
tree9d9c049244674d4b191b67ff238884b0c8442f92 /LibGUI/GWindow.cpp
parent42c95959a8ea883669491499d8d890881ff20031 (diff)
downloadserenity-dcf6726487d17f5fb36803e3b8d74ed75ee4fa53.zip
WindowServer: Add support for per-window override cursors.
Use this to implement automatic switching to an I-beam cursor when hovering over a GTextEditor. :^)
Diffstat (limited to 'LibGUI/GWindow.cpp')
-rw-r--r--LibGUI/GWindow.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/LibGUI/GWindow.cpp b/LibGUI/GWindow.cpp
index 7c8e1461eb..3c9bc8bf73 100644
--- a/LibGUI/GWindow.cpp
+++ b/LibGUI/GWindow.cpp
@@ -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()) {