summaryrefslogtreecommitdiff
path: root/LibGUI/GMenu.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-14 01:53:19 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-14 01:53:19 +0200
commit91e1f3ffb1f6d967a0b1ca3af09d75d5c1ac0212 (patch)
tree98c2b357b14dae6a2749f15d97524cb09c764859 /LibGUI/GMenu.cpp
parent29d0412a06adb134658c065ff5c801e20afdf7e5 (diff)
downloadserenity-91e1f3ffb1f6d967a0b1ca3af09d75d5c1ac0212.zip
LibGUI+WindowServer: Add a way to dismiss opened menus from the client.
Diffstat (limited to 'LibGUI/GMenu.cpp')
-rw-r--r--LibGUI/GMenu.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/LibGUI/GMenu.cpp b/LibGUI/GMenu.cpp
index 3aab5feaba..aad2732f47 100644
--- a/LibGUI/GMenu.cpp
+++ b/LibGUI/GMenu.cpp
@@ -50,6 +50,16 @@ void GMenu::popup(const Point& screen_position)
GEventLoop::post_message_to_server(request);
}
+void GMenu::dismiss()
+{
+ if (!m_menu_id)
+ return;
+ WSAPI_ClientMessage request;
+ request.type = WSAPI_ClientMessage::Type::DismissMenu;
+ request.menu.menu_id = m_menu_id;
+ GEventLoop::post_message_to_server(request);
+}
+
int GMenu::realize_menu()
{
WSAPI_ClientMessage request;