mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 16:35:08 +00:00
LibGUI: Add GUI::Application::active_window()
Instead of each window having a bool flag that says whether that window is currently active, have a pointer to the active window on the app object instead.
This commit is contained in:
parent
8b90e8d08b
commit
1c8eaf28cd
4 changed files with 31 additions and 3 deletions
|
@ -235,4 +235,16 @@ void Application::tooltip_hide_timer_did_fire()
|
|||
m_tooltip_window->hide();
|
||||
}
|
||||
|
||||
void Application::window_did_become_active(Badge<Window>, Window& window)
|
||||
{
|
||||
m_active_window = window.make_weak_ptr<Window>();
|
||||
}
|
||||
|
||||
void Application::window_did_become_inactive(Badge<Window>, Window& window)
|
||||
{
|
||||
if (m_active_window.ptr() != &window)
|
||||
return;
|
||||
m_active_window = nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue