summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/Window.cpp
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2020-07-24 16:16:30 -0400
committerAndreas Kling <kling@serenityos.org>2020-07-26 11:32:12 +0200
commitc50f258b7a9cb56ab6de3c06c95b6d67212c9daf (patch)
tree34c9c8ab7c7c9ac8d6569c018cafdfd2dd58c3ec /Libraries/LibGUI/Window.cpp
parent030f4150b83e04cf84a228f6f816b9481ecabc10 (diff)
downloadserenity-c50f258b7a9cb56ab6de3c06c95b6d67212c9daf.zip
LibGUI+WindowServer: Allow applets to retrieve their location
MenuApplet windows can now call rect_in_menubar to return their location in the MenuBar.
Diffstat (limited to 'Libraries/LibGUI/Window.cpp')
-rw-r--r--Libraries/LibGUI/Window.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibGUI/Window.cpp b/Libraries/LibGUI/Window.cpp
index 30d4473de6..f590184ff2 100644
--- a/Libraries/LibGUI/Window.cpp
+++ b/Libraries/LibGUI/Window.cpp
@@ -177,6 +177,12 @@ String Window::title() const
return WindowServerConnection::the().send_sync<Messages::WindowServer::GetWindowTitle>(m_window_id)->title();
}
+Gfx::IntRect Window::rect_in_menubar() const
+{
+ ASSERT(m_window_type == WindowType::MenuApplet);
+ return WindowServerConnection::the().send_sync<Messages::WindowServer::GetWindowRectInMenubar>(m_window_id)->rect();
+}
+
Gfx::IntRect Window::rect() const
{
if (!is_visible())