1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00

WindowServer: Always restore modal chain when clicking a window

Refactors restore helper into move_to_front_and_make_active().
Fixes not bringing all modal children to the front when any modal
child or its modeless parent is clicked.
This commit is contained in:
thankyouverycool 2022-08-25 14:41:33 -04:00 committed by Andreas Kling
parent d815f659cc
commit aa045a9fdf
4 changed files with 8 additions and 13 deletions

View file

@ -342,6 +342,12 @@ void WindowManager::add_window(Window& window)
void WindowManager::move_to_front_and_make_active(Window& window)
{
for_each_window_in_modal_chain(window, [&](auto& w) {
w.set_minimized(false);
w.window_stack().move_to_front(w);
return IterationDecision::Continue;
});
auto* blocker = window.blocking_modal_window();
if (blocker && !window.is_capturing_input()) {
blocker->window_stack().move_to_front(*blocker);
@ -2134,16 +2140,6 @@ void WindowManager::did_popup_a_menu(Badge<Menu>)
set_automatic_cursor_tracking_window(nullptr);
}
void WindowManager::restore_modal_chain(Window& window)
{
for_each_window_in_modal_chain(window, [&](auto& w) {
w.set_minimized(false);
w.window_stack().move_to_front(w);
return IterationDecision::Continue;
});
move_to_front_and_make_active(window);
}
void WindowManager::minimize_windows(Window& window, bool minimized)
{
for_each_window_in_modal_chain(window, [&](auto& w) {