mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:48:11 +00:00
LibGUI+WindowServer: Allow applets to retrieve their location
MenuApplet windows can now call rect_in_menubar to return their location in the MenuBar.
This commit is contained in:
parent
030f4150b8
commit
c50f258b7a
5 changed files with 21 additions and 0 deletions
|
@ -424,6 +424,17 @@ OwnPtr<Messages::WindowServer::GetWindowRectResponse> ClientConnection::handle(c
|
|||
return make<Messages::WindowServer::GetWindowRectResponse>(it->value->rect());
|
||||
}
|
||||
|
||||
OwnPtr<Messages::WindowServer::GetWindowRectInMenubarResponse> ClientConnection::handle(const Messages::WindowServer::GetWindowRectInMenubar& message)
|
||||
{
|
||||
int window_id = message.window_id();
|
||||
auto it = m_windows.find(window_id);
|
||||
if (it == m_windows.end()) {
|
||||
did_misbehave("GetWindowRectInMenubar: Bad window ID");
|
||||
return nullptr;
|
||||
}
|
||||
return make<Messages::WindowServer::GetWindowRectInMenubarResponse>(it->value->rect_in_menubar());
|
||||
}
|
||||
|
||||
Window* ClientConnection::window_from_id(i32 window_id)
|
||||
{
|
||||
auto it = m_windows.find(window_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue