mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:08:12 +00:00
WindowServer: Add a new IPC to set the cursor position
This commit is contained in:
parent
86a4d0694f
commit
5397845a41
3 changed files with 14 additions and 0 deletions
|
@ -894,6 +894,18 @@ void ClientConnection::pong()
|
|||
set_unresponsive(false);
|
||||
}
|
||||
|
||||
void ClientConnection::set_global_cursor_position(Gfx::IntPoint const& position)
|
||||
{
|
||||
if (!Screen::main().rect().contains(position)) {
|
||||
did_misbehave("SetGlobalCursorPosition with bad position");
|
||||
return;
|
||||
}
|
||||
if (position != ScreenInput::the().cursor_location()) {
|
||||
ScreenInput::the().set_cursor_location(position);
|
||||
Compositor::the().invalidate_cursor();
|
||||
}
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetGlobalCursorPositionResponse ClientConnection::get_global_cursor_position()
|
||||
{
|
||||
return ScreenInput::the().cursor_location();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue