summaryrefslogtreecommitdiff
path: root/Userland/Services/WindowServer/ClientConnection.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-03-30 23:30:50 +0200
committerAndreas Kling <kling@serenityos.org>2021-03-30 23:43:24 +0200
commit0cd60a28ba0496e829f00b1e9f6d0c4052c637f4 (patch)
tree7c6d592cd953d0b963bd0ebeffdd58c320e57c3c /Userland/Services/WindowServer/ClientConnection.cpp
parent9bbc1c9c930157ba89eb0c3554a67bf4bd6fe7cb (diff)
downloadserenity-0cd60a28ba0496e829f00b1e9f6d0c4052c637f4.zip
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. :^)
Diffstat (limited to 'Userland/Services/WindowServer/ClientConnection.cpp')
-rw-r--r--Userland/Services/WindowServer/ClientConnection.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/Userland/Services/WindowServer/ClientConnection.cpp b/Userland/Services/WindowServer/ClientConnection.cpp
index b16b708d0f..77ff8e1ab7 100644
--- a/Userland/Services/WindowServer/ClientConnection.cpp
+++ b/Userland/Services/WindowServer/ClientConnection.cpp
@@ -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)