Moved check for existence of active window into shift_window().