mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +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:
parent
e50874621a
commit
603c17262c
Notes:
sideshowbarker
2024-07-19 04:45:20 +09:00
Author: https://github.com/tomuta
Commit: 603c17262c
Pull-request: https://github.com/SerenityOS/serenity/pull/2822
3 changed files with 17 additions and 1 deletions
|
@ -634,4 +634,17 @@ void Window::set_progress(int progress)
|
|||
WindowManager::the().notify_progress_changed(*this);
|
||||
}
|
||||
|
||||
bool Window::is_descendant_of(Window& window) const
|
||||
{
|
||||
for (auto* parent = parent_window(); parent; parent = parent->parent_window()) {
|
||||
if (parent == &window)
|
||||
return true;
|
||||
for (auto& accessory : parent->accessory_windows()) {
|
||||
if (accessory == &window)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue