From 9b740f218b103a5f3497a666b2655865266c8ff1 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 5 Apr 2021 14:32:34 +0200 Subject: WindowServer+LibGUI: Notify clients when menus become visible/hidden This will allow clients to react to these events. --- Userland/Libraries/LibGUI/Menu.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Userland/Libraries/LibGUI/Menu.cpp') diff --git a/Userland/Libraries/LibGUI/Menu.cpp b/Userland/Libraries/LibGUI/Menu.cpp index d3a4da4b57..14534d3c9c 100644 --- a/Userland/Libraries/LibGUI/Menu.cpp +++ b/Userland/Libraries/LibGUI/Menu.cpp @@ -162,4 +162,13 @@ Action* Menu::action_at(size_t index) return m_items[index].action(); } +void Menu::visibility_did_change(Badge, bool visible) +{ + if (m_visible == visible) + return; + m_visible = visible; + if (on_visibility_change) + on_visibility_change(visible); +} + } -- cgit v1.2.3