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:
parent
522f6775a7
commit
88e6d18a61
Notes:
sideshowbarker
2024-07-18 08:50:00 +09:00
Author: https://github.com/timmot Commit: https://github.com/SerenityOS/serenity/commit/88e6d18a61b Pull-request: https://github.com/SerenityOS/serenity/pull/8636 Issue: https://github.com/SerenityOS/serenity/issues/8628 Issue: https://github.com/SerenityOS/serenity/issues/8630 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/awesomekling
3 changed files with 20 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -164,6 +164,7 @@ private:
|
|||
virtual Messages::WindowServer::IsWindowModifiedResponse is_window_modified(i32) override;
|
||||
virtual Messages::WindowServer::GetDesktopDisplayScaleResponse get_desktop_display_scale(u32) override;
|
||||
virtual void set_flash_flush(bool) override;
|
||||
virtual void set_window_parent_from_client(i32, i32, i32) override;
|
||||
|
||||
Window* window_from_id(i32 window_id);
|
||||
|
||||
|
|
|
@ -147,4 +147,6 @@ endpoint WindowServer
|
|||
get_desktop_display_scale(u32 screen_index) => (int desktop_display_scale)
|
||||
|
||||
set_flash_flush(bool enabled) =|
|
||||
|
||||
set_window_parent_from_client(i32 client_id, i32 parent_id, i32 child_id) =|
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue