1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 17:47:44 +00:00

WindowServer: Find parent taskbar rect for minimize animation

If a modal window is being minimized, it may not have its own
taskbar rectangle. In that case, try finding a parent in the
modal window stack that does have one, and use that for the
animation.
This commit is contained in:
Tom 2020-08-18 13:33:43 -06:00 committed by Andreas Kling
parent e035640cd5
commit 2552e3be00
4 changed files with 43 additions and 7 deletions

View file

@ -182,7 +182,7 @@ public:
void maximize_windows(Window&, bool);
template<typename Function>
void for_each_window_in_modal_stack(Window& window, Function f)
IterationDecision for_each_window_in_modal_stack(Window& window, Function f)
{
auto* blocking_modal_window = window.is_blocked_by_modal_window();
if (blocking_modal_window || window.is_modal()) {
@ -198,13 +198,15 @@ public:
}
if (!modal_stack.is_empty()) {
for (size_t i = modal_stack.size(); i > 0; i--) {
f(*modal_stack[i - 1], false);
IterationDecision decision = f(*modal_stack[i - 1], false);
if (decision != IterationDecision::Continue)
return decision;
}
}
f(*modal_stack_top, true);
return f(*modal_stack_top, true);
} else {
// Not a modal window stack, just "iterate" over this window
f(window, true);
return f(window, true);
}
}