Merge "Refactor dispatching the focus event from handleWindowFocusChanged"