diff --git a/Services/WindowServer/ClientConnection.cpp b/Services/WindowServer/ClientConnection.cpp index 8e390469ed..a977c4fffe 100644 --- a/Services/WindowServer/ClientConnection.cpp +++ b/Services/WindowServer/ClientConnection.cpp @@ -877,6 +877,11 @@ void ClientConnection::handle(const Messages::WindowServer::Pong&) set_unresponsive(false); } +OwnPtr ClientConnection::handle(const Messages::WindowServer::GetGlobalCursorPosition&) +{ + return make(Screen::the().cursor_location()); +} + void ClientConnection::set_unresponsive(bool unresponsive) { if (m_unresponsive == unresponsive) diff --git a/Services/WindowServer/ClientConnection.h b/Services/WindowServer/ClientConnection.h index fe1a23afa9..5a8bde4e85 100644 --- a/Services/WindowServer/ClientConnection.h +++ b/Services/WindowServer/ClientConnection.h @@ -144,6 +144,7 @@ private: virtual void handle(const Messages::WindowServer::DisableDisplayLink&) override; virtual void handle(const Messages::WindowServer::SetWindowProgress&) override; virtual void handle(const Messages::WindowServer::Pong&) override; + virtual OwnPtr handle(const Messages::WindowServer::GetGlobalCursorPosition&) override; Window* window_from_id(i32 window_id); diff --git a/Services/WindowServer/WindowServer.ipc b/Services/WindowServer/WindowServer.ipc index 1fdf9f070f..b28d4e283a 100644 --- a/Services/WindowServer/WindowServer.ipc +++ b/Services/WindowServer/WindowServer.ipc @@ -105,5 +105,7 @@ endpoint WindowServer = 2 EnableDisplayLink() =| DisableDisplayLink() =| + GetGlobalCursorPosition() => (Gfx::IntPoint position) + Pong() =| }