added logic to disable window flash when window is hidden