diff options
author | Andreas Kling <kling@serenityos.org> | 2021-04-05 14:32:34 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-05 18:09:04 +0200 |
commit | 9b740f218b103a5f3497a666b2655865266c8ff1 (patch) | |
tree | 6f94769e391237b36a57868c553458c21298fe62 /Userland/Libraries/LibGUI/Menu.cpp | |
parent | 03157418159c75c03d0bf94108e9f6d9053835bf (diff) | |
download | serenity-9b740f218b103a5f3497a666b2655865266c8ff1.zip |
WindowServer+LibGUI: Notify clients when menus become visible/hidden
This will allow clients to react to these events.
Diffstat (limited to 'Userland/Libraries/LibGUI/Menu.cpp')
-rw-r--r-- | Userland/Libraries/LibGUI/Menu.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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<WindowServerConnection>, bool visible) +{ + if (m_visible == visible) + return; + m_visible = visible; + if (on_visibility_change) + on_visibility_change(visible); +} + } |