mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
WindowServer: Add WindowServer::get_window_rect_from_client()
This allows a client to get the rect of a window in another client.
This commit is contained in:
parent
88e6d18a61
commit
b77b631571
Notes:
sideshowbarker
2024-07-18 08:49:57 +09:00
Author: https://github.com/timmot Commit: https://github.com/SerenityOS/serenity/commit/b77b6315710 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 15 additions and 0 deletions
|
@ -1132,4 +1132,17 @@ void ClientConnection::set_window_parent_from_client(i32 client_id, i32 parent_i
|
|||
child_window->set_parent_window(*parent_window);
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetWindowRectFromClientResponse ClientConnection::get_window_rect_from_client(i32 client_id, i32 window_id)
|
||||
{
|
||||
auto client_connection = from_client_id(client_id);
|
||||
if (!client_connection)
|
||||
did_misbehave("GetWindowRectFromClient: Bad client ID");
|
||||
|
||||
auto window = client_connection->window_from_id(window_id);
|
||||
if (!window)
|
||||
did_misbehave("GetWindowRectFromClient: Bad window ID");
|
||||
|
||||
return window->rect();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -165,6 +165,7 @@ private:
|
|||
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;
|
||||
virtual Messages::WindowServer::GetWindowRectFromClientResponse get_window_rect_from_client(i32, i32) override;
|
||||
|
||||
Window* window_from_id(i32 window_id);
|
||||
|
||||
|
|
|
@ -149,4 +149,5 @@ endpoint WindowServer
|
|||
set_flash_flush(bool enabled) =|
|
||||
|
||||
set_window_parent_from_client(i32 client_id, i32 parent_id, i32 child_id) =|
|
||||
get_window_rect_from_client(i32 client_id, i32 window_id) => (Gfx::IntRect rect)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue