diff options
author | Yukawa@chromium.org <Yukawa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-21 08:16:24 +0000 |
---|---|---|
committer | Yukawa@chromium.org <Yukawa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-21 08:16:24 +0000 |
commit | 5229c4c36c1769a471c197802c84ccd777e652bd (patch) | |
tree | e1d1df5af33d8f481eb69f0123a72f2c46ea6e06 /ui/base/win | |
parent | 872f3a9486e431851b0b97599781e743561ee020 (diff) | |
download | chromium_src-5229c4c36c1769a471c197802c84ccd777e652bd.zip chromium_src-5229c4c36c1769a471c197802c84ccd777e652bd.tar.gz chromium_src-5229c4c36c1769a471c197802c84ccd777e652bd.tar.bz2 |
Ignore MoveImeWindow when the target window has no input focus.
In issue 240189, I found that the renderer generates
SelectionBoundsChanged event even when it has no input
focus. (e.g, typing something in the search text box,
which causes relayouting in the Blink and the selection
bounds may change)
When this happens, ImmSetCandidateWindow/ImmSetCompositionWindow/
SetCaretPos will be called for an unfocused window with
unexpected caret position.
With this patch set, ImeInput::MoveImeWindow does nothing
when the target window has no input focus.
BUG=240189
TEST=Manually done on Windows 7 with built-in Chinese Simplified QuanPin (version 6.0)
Review URL: https://chromiumcodereview.appspot.com/15126002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201253 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base/win')
-rw-r--r-- | ui/base/win/ime_input.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/base/win/ime_input.cc b/ui/base/win/ime_input.cc index a467138..9c604f7 100644 --- a/ui/base/win/ime_input.cc +++ b/ui/base/win/ime_input.cc @@ -203,6 +203,14 @@ void ImeInput::DestroyImeWindow(HWND window_handle) { } void ImeInput::MoveImeWindow(HWND window_handle, HIMC imm_context) { + // Does nothing when the target window has no input focus. This is important + // because the renderer may issue SelectionBoundsChanged event even when it + // has no input focus. (e.g. the page update caused by incremental search.) + // So this event should be ignored when the |window_handle| no longer has the + // input focus. + if (GetFocus() != window_handle) + return; + int x = caret_rect_.x(); int y = caret_rect_.y(); |