improve: detection of change of active window