Only updates UI if window has focus.