1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 08:28:11 +00:00

WindowServer+LibGUI: Notify clients when menus become visible/hidden

This will allow clients to react to these events.
This commit is contained in:
Andreas Kling 2021-04-05 14:32:34 +02:00
parent 0315741815
commit 9b740f218b
8 changed files with 49 additions and 9 deletions

View file

@ -59,6 +59,12 @@ public:
void popup(const Gfx::IntPoint& screen_position, const RefPtr<Action>& default_action = nullptr);
void dismiss();
void visibility_did_change(Badge<WindowServerConnection>, bool visible);
Function<void(bool)> on_visibility_change;
bool is_visible() const { return m_visible; }
private:
friend class MenuBar;
@ -71,6 +77,7 @@ private:
RefPtr<Gfx::Bitmap> m_icon;
NonnullOwnPtrVector<MenuItem> m_items;
WeakPtr<Action> m_last_default_action;
bool m_visible { false };
};
}