Adding methods to allow apps to respond to a window being activated or deactivated, and to determine whether a window is active or inactive (Window::isActive, App::activate and App::deactivate)