1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 08:28:11 +00:00

WindowManager: Close tooltip child_windows of previously active window

This closes the autocomplete_box used in applications like GML
Playground and HackStudio when the user switches focus to a new window.
This commit is contained in:
Sreelakshmi 2021-06-12 10:58:38 +05:30 committed by Ali Mohammad Pur
parent a471af4ae1
commit aa68c12cfc

View file

@ -1397,6 +1397,10 @@ void WindowManager::set_active_window(Window* window, bool make_input)
auto* previously_active_window = m_active_window.ptr();
if (previously_active_window) {
for (auto& child_window : previously_active_window->child_windows()) {
if (child_window && child_window->type() == WindowType::Tooltip)
child_window->request_close();
}
Core::EventLoop::current().post_event(*previously_active_window, make<Event>(Event::WindowDeactivated));
previously_active_window->invalidate(true, true);
m_active_window = nullptr;