diff --git a/Userland/Libraries/LibGUI/Window.cpp b/Userland/Libraries/LibGUI/Window.cpp index 87a117c07f..526bce67c9 100644 --- a/Userland/Libraries/LibGUI/Window.cpp +++ b/Userland/Libraries/LibGUI/Window.cpp @@ -491,6 +491,8 @@ void Window::handle_became_active_or_inactive_event(Core::Event& event) Application::the()->window_did_become_active({}, *this); else Application::the()->window_did_become_inactive({}, *this); + if (on_active_window_change) + on_active_window_change(event.type() == Event::WindowBecameActive); if (m_main_widget) m_main_widget->dispatch_event(event, this); if (m_focused_widget) diff --git a/Userland/Libraries/LibGUI/Window.h b/Userland/Libraries/LibGUI/Window.h index 18945fee26..a6d5b3db8b 100644 --- a/Userland/Libraries/LibGUI/Window.h +++ b/Userland/Libraries/LibGUI/Window.h @@ -83,6 +83,7 @@ public: Function on_close; Function on_close_request; Function on_active_input_change; + Function on_active_window_change; int x() const { return rect().x(); } int y() const { return rect().y(); }