mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:17:35 +00:00
WindowServer+LibGUI: Plumb mouse/enter/leave events to applet windows
Since applet windows live in the applet area window, the AppletManager has to keep track of which applet is hovered and send the appropriate enter/leave events to the applet windows. This makes applet tooltips work again. :^)
This commit is contained in:
parent
9bbc1c9c93
commit
0cd60a28ba
9 changed files with 44 additions and 13 deletions
|
@ -475,15 +475,20 @@ OwnPtr<Messages::WindowServer::GetWindowMinimumSizeResponse> ClientConnection::h
|
|||
return make<Messages::WindowServer::GetWindowMinimumSizeResponse>(it->value->minimum_size());
|
||||
}
|
||||
|
||||
OwnPtr<Messages::WindowServer::GetWindowRectInMenubarResponse> ClientConnection::handle(const Messages::WindowServer::GetWindowRectInMenubar& message)
|
||||
OwnPtr<Messages::WindowServer::GetAppletRectOnScreenResponse> ClientConnection::handle(const Messages::WindowServer::GetAppletRectOnScreen& 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");
|
||||
did_misbehave("GetAppletRectOnScreen: Bad window ID");
|
||||
return {};
|
||||
}
|
||||
return make<Messages::WindowServer::GetWindowRectInMenubarResponse>(it->value->rect_in_applet_area());
|
||||
|
||||
Gfx::IntRect applet_area_rect;
|
||||
if (auto* applet_area_window = AppletManager::the().window())
|
||||
applet_area_rect = applet_area_window->rect();
|
||||
|
||||
return make<Messages::WindowServer::GetAppletRectOnScreenResponse>(it->value->rect_in_applet_area().translated(applet_area_rect.location()));
|
||||
}
|
||||
|
||||
Window* ClientConnection::window_from_id(i32 window_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue