Fix window focus bug.