mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +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:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user