1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:17:35 +00:00

WindowServer: Add WindowServer::async_set_window_parent_from_client()

This allows a client to set the parent for one of its local windows
where the parent window is in another client.
This commit is contained in:
Timothy 2021-07-13 00:35:46 +10:00 committed by Andreas Kling
parent 522f6775a7
commit 88e6d18a61
3 changed files with 20 additions and 0 deletions

View file

@ -1115,4 +1115,21 @@ void ClientConnection::set_flash_flush(bool enabled)
Compositor::the().set_flash_flush(enabled);
}
void ClientConnection::set_window_parent_from_client(i32 client_id, i32 parent_id, i32 child_id)
{
auto child_window = window_from_id(child_id);
if (!child_window)
did_misbehave("SetWindowParentFromClient: Bad child window ID");
auto client_connection = from_client_id(client_id);
if (!client_connection)
did_misbehave("SetWindowParentFromClient: Bad client ID");
auto parent_window = client_connection->window_from_id(parent_id);
if (!parent_window)
did_misbehave("SetWindowParentFromClient: Bad parent window ID");
child_window->set_parent_window(*parent_window);
}
}