Remove ::SetFocus API call in RWHVEH::SetKeyboardFocus
Text service framework(TSF) on Windows platform already triggers a focus call to the top level HWND that should receive keyboard focus. This happens in |TSFBridgeImpl::OnTextInputTypeChanged| and |TSFBridgeImpl::UpdateAssociateFocus| where the thread input manager sets focus on the HWND by calling |SetFocus| and |AssociateFocus| respectively. |RenderWidgetHostViewEventHandler::SetKeyboardFocus| explicitly calls |::SetFocus| on the HWND that leads to side-effects when narrator is active as it intermittently switches focus to the legacy HWND that results in VK dismissal and also puts the state machine of the VK in a weird state. Calling |::SetFocus| also has perf implications as TSF listens to this API call and does a reentrant call to Chromium to fetch document states. I tested both hardware and virtual keyboard with this change and I don't see any obvious issues. Removing this call also fixed the accessibility issue where the VK was getting dismissed after first keystroke. Bug: 1106556 Change-Id: If8146d2b97a36799a8ade1c514fb238c67e76b36 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2314980Reviewed-by:Bruce Dawson <brucedawson@chromium.org> Reviewed-by:
Sadrul Chowdhury <sadrul@chromium.org> Reviewed-by:
Dominic Mazzoni <dmazzoni@chromium.org> Commit-Queue: Anupam Snigdha <snianu@microsoft.com> Cr-Commit-Position: refs/heads/master@{#791634}
Showing
Please register or sign in to comment