summaryrefslogtreecommitdiff
path: root/LibGUI
diff options
context:
space:
mode:
authorRobin Burchell <robin+git@viroteck.net>2019-05-16 01:06:21 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-05-16 01:22:54 +0200
commitf55965b5e84ac61a58aaed6e055680ca317a8540 (patch)
tree1fb4f3bba1990bab449896b2c770f2dd719187bf /LibGUI
parenta4b0dfff431579b45fc4d4c6439e74d79fc0e859 (diff)
downloadserenity-f55965b5e84ac61a58aaed6e055680ca317a8540.zip
WindowServer/GMenu: Adjust the popup position to fit the window inside the screen
Rather than passing a "top_anchored" bool. Fixes #22.
Diffstat (limited to 'LibGUI')
-rw-r--r--LibGUI/GMenu.cpp3
-rw-r--r--LibGUI/GMenu.h2
2 files changed, 2 insertions, 3 deletions
diff --git a/LibGUI/GMenu.cpp b/LibGUI/GMenu.cpp
index 2a1864802d..c97d5cbddf 100644
--- a/LibGUI/GMenu.cpp
+++ b/LibGUI/GMenu.cpp
@@ -39,7 +39,7 @@ void GMenu::add_separator()
m_items.append(make<GMenuItem>(m_menu_id, GMenuItem::Separator));
}
-void GMenu::popup(const Point& screen_position, bool top_anchored)
+void GMenu::popup(const Point& screen_position)
{
if (!m_menu_id)
realize_menu();
@@ -47,7 +47,6 @@ void GMenu::popup(const Point& screen_position, bool top_anchored)
request.type = WSAPI_ClientMessage::Type::PopupMenu;
request.menu.menu_id = m_menu_id;
request.menu.position = screen_position;
- request.menu.top_anchored = top_anchored;
GEventLoop::post_message_to_server(request);
}
diff --git a/LibGUI/GMenu.h b/LibGUI/GMenu.h
index 3019444557..a5280393dc 100644
--- a/LibGUI/GMenu.h
+++ b/LibGUI/GMenu.h
@@ -21,7 +21,7 @@ public:
void add_action(Retained<GAction>);
void add_separator();
- void popup(const Point& screen_position, bool top_anchored = true);
+ void popup(const Point& screen_position);
void dismiss();
Function<void(unsigned)> on_item_activation;