Commit 84c57c99 authored by Siye Liu's avatar Siye Liu Committed by Commit Bot

Should notify input service about focus change for same input type.

We should call |ITfThreadMgr::SetFocus| to notify input service about
focus change even if the input type has not changed.

This issue is introduced by crrev.com/810350.

Bug: 1133474
Bug: 1124612

Change-Id: I219fb624fb649b870bc081fbdac56373c1102d66
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2438478Reviewed-by: default avatarSiye Liu <siliu@microsoft.com>
Reviewed-by: default avatarYohei Yukawa <yukawa@chromium.org>
Commit-Queue: Siye Liu <siliu@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#812203}
parent dae1b502
...@@ -233,10 +233,7 @@ void TSFBridgeImpl::OnTextInputTypeChanged(const TextInputClient* client) { ...@@ -233,10 +233,7 @@ void TSFBridgeImpl::OnTextInputTypeChanged(const TextInputClient* client) {
return; return;
} }
TextInputType new_input_type = client_->GetTextInputType(); input_type_ = client_->GetTextInputType();
if (new_input_type == input_type_)
return;
input_type_ = new_input_type;
TSFDocument* document = GetAssociatedDocument(); TSFDocument* document = GetAssociatedDocument();
if (!document) if (!document)
return; return;
...@@ -245,7 +242,7 @@ void TSFBridgeImpl::OnTextInputTypeChanged(const TextInputClient* client) { ...@@ -245,7 +242,7 @@ void TSFBridgeImpl::OnTextInputTypeChanged(const TextInputClient* client) {
// focus notifications for the same text input type so we don't // focus notifications for the same text input type so we don't
// call AssociateFocus and SetFocus together. Just calling SetFocus // call AssociateFocus and SetFocus together. Just calling SetFocus
// should be sufficient for setting focus on a textstore. // should be sufficient for setting focus on a textstore.
if (new_input_type != TEXT_INPUT_TYPE_NONE) if (input_type_ != TEXT_INPUT_TYPE_NONE)
thread_manager_->SetFocus(document->document_manager.Get()); thread_manager_->SetFocus(document->document_manager.Get());
else else
UpdateAssociateFocus(); UpdateAssociateFocus();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment