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:
parent
a471af4ae1
commit
aa68c12cfc
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue