mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 13:57:35 +00:00
WindowServer: Add foremost_popup_window() helper
This commit is contained in:
parent
3027cf7e99
commit
c23adeaaf7
2 changed files with 15 additions and 0 deletions
|
@ -2374,4 +2374,18 @@ bool WindowManager::sync_config_to_disk()
|
|||
return true;
|
||||
}
|
||||
|
||||
Window* WindowManager::foremost_popup_window(WindowStack& stack)
|
||||
{
|
||||
Window* popup_window = nullptr;
|
||||
for_each_visible_window_from_front_to_back([&](Window& window) {
|
||||
if (window.type() == WindowType::Popup) {
|
||||
popup_window = &window;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
},
|
||||
&stack);
|
||||
return popup_window;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -98,6 +98,7 @@ public:
|
|||
return m_current_window_stack->active_window();
|
||||
}
|
||||
|
||||
Window* foremost_popup_window(WindowStack& stack = WindowManager::the().current_window_stack());
|
||||
Window* active_input_window()
|
||||
{
|
||||
VERIFY(m_current_window_stack);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue