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

WindowServer: Fix traversing modal stack

When walking the modal window stack upwards, we need to check if
the top modal window is still a descendant of the window that
the parent is blocked by. Fixes not all windows being brought to
the front when trying to active a parent in the middle of the
modal window stack.
This commit is contained in:
Tom 2020-07-16 09:39:52 -06:00 committed by Andreas Kling
parent e50874621a
commit 603c17262c
3 changed files with 17 additions and 1 deletions

View file

@ -193,7 +193,8 @@ public:
Vector<Window*> modal_stack;
auto* modal_stack_top = blocking_modal_window ? blocking_modal_window : &window;
for (auto* parent = modal_stack_top->parent_window(); parent; parent = parent->parent_window()) {
if (parent->is_blocked_by_modal_window() != modal_stack_top)
auto* blocked_by = parent->is_blocked_by_modal_window();
if (!blocked_by || (blocked_by != modal_stack_top && !modal_stack_top->is_descendant_of(*blocked_by)))
break;
modal_stack.append(parent);
if (!parent->is_modal())