mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
WindowServer: Add missing minimize check to highlighted window callback
This patch adds a missing minimize check for highligted windows in WindowStack::for_each_visible_window_of_type_from_front_to_back(). Minimized windows should not be treated as visible in this context. Previously, iterating through each visible Window when recomputing occlusions in the Compositor would cause a crash if a highlighted Window is also minimized at the same time. As the WindowSwitcher currently highligts Windows even when they are minimized, opening it while any Window is minimized would cause WindowServer to crash.
This commit is contained in:
parent
791a018c99
commit
dac7b25b8a
Notes:
sideshowbarker
2024-07-18 10:03:13 +09:00
Author: https://github.com/networkException Commit: https://github.com/SerenityOS/serenity/commit/dac7b25b8aa Pull-request: https://github.com/SerenityOS/serenity/pull/8565
1 changed files with 2 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2021, Jakob-Niklas See <git@nwex.de>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -122,7 +123,7 @@ template<typename Callback>
|
|||
inline IterationDecision WindowStack::for_each_visible_window_of_type_from_front_to_back(WindowType type, Callback callback, bool ignore_highlight)
|
||||
{
|
||||
auto* highlight_window = this->highlight_window();
|
||||
if (!ignore_highlight && highlight_window && highlight_window->type() == type && highlight_window->is_visible()) {
|
||||
if (!ignore_highlight && highlight_window && highlight_window->type() == type && highlight_window->is_visible() && !highlight_window->is_minimized()) {
|
||||
if (callback(*highlight_window) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue