Fix an issue with window focus.