diff options
Diffstat (limited to 'Userland/Services/WindowServer/MenuManager.cpp')
-rw-r--r-- | Userland/Services/WindowServer/MenuManager.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Services/WindowServer/MenuManager.cpp b/Userland/Services/WindowServer/MenuManager.cpp index 3a882c7b46..ad0e8543aa 100644 --- a/Userland/Services/WindowServer/MenuManager.cpp +++ b/Userland/Services/WindowServer/MenuManager.cpp @@ -229,6 +229,14 @@ void MenuManager::close_everyone() clear_current_menu(); } +Menu* MenuManager::closest_open_ancestor_of(Menu const& other) const +{ + for (auto& menu : m_open_menu_stack.in_reverse()) + if (menu->is_menu_ancestor_of(other)) + return menu.ptr(); + return nullptr; +} + void MenuManager::close_everyone_not_in_lineage(Menu& menu) { Vector<Menu&> menus_to_close; |