From 91e1f3ffb1f6d967a0b1ca3af09d75d5c1ac0212 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 14 Apr 2019 01:53:19 +0200 Subject: LibGUI+WindowServer: Add a way to dismiss opened menus from the client. --- LibGUI/GMenu.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'LibGUI/GMenu.cpp') 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; -- cgit v1.2.3