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

WindowServer: Fix picking new active window after destroy

We need to mark windows as destroyed and not consider them
when picking a new active window. Fixes lost focus after
closing some windows.
This commit is contained in:
Tom 2020-07-16 11:08:39 -06:00 committed by Andreas Kling
parent 603c17262c
commit f591157eb8
4 changed files with 29 additions and 7 deletions

View file

@ -475,12 +475,19 @@ void ClientConnection::destroy_window(Window& window, Vector<i32>& destroyed_win
destroy_window(*child_window, destroyed_window_ids);
}
for (auto& accessory_window : window.accessory_windows()) {
if (!accessory_window)
continue;
ASSERT(accessory_window->window_id() != window.window_id());
destroy_window(*accessory_window, destroyed_window_ids);
}
destroyed_window_ids.append(window.window_id());
if (window.type() == WindowType::MenuApplet)
AppletManager::the().remove_applet(window);
window.invalidate();
window.destroy();
remove_child(window);
m_windows.remove(window.window_id());
}