summaryrefslogtreecommitdiffstats
path: root/ui/base
diff options
context:
space:
mode:
authorYukawa@chromium.org <Yukawa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-24 07:59:02 +0000
committerYukawa@chromium.org <Yukawa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-24 07:59:02 +0000
commite172d1a7a79e2ecbf90786338120a19fa1a451d4 (patch)
tree9edef909e7c9b00c5bbae9d30092d5e5c3135d89 /ui/base
parent0fff454fdc718cb0253e04e7cb1d74ff939f3bc7 (diff)
downloadchromium_src-e172d1a7a79e2ecbf90786338120a19fa1a451d4.zip
chromium_src-e172d1a7a79e2ecbf90786338120a19fa1a451d4.tar.gz
chromium_src-e172d1a7a79e2ecbf90786338120a19fa1a451d4.tar.bz2
ImeInput::MoveImeWindow is responsible for notifying IMEs about where
the candidate window should be displayed via ImmSetCandidateWindow API. Currently ImmSetCandidateWindow API is called twice. The first API call uses CFS_CANDIDATEPOS flag for Chinese IMEs while the second API call uses CFS_EXCLUDE flag for IMEs in other languages such as Japanese or Korean. For IMEs which accept both the flags, the current behavior sometimes causes jerkiness of the candidate window position because the candidate window, which is displayed by the first API call, moves into different position by the second API call. With this change set, the first API call will no longer happen except for Chinese IMEs. BUG=62020 TEST=Tested on GoogleJapaneseInput 1.3.974.0 on Windows 7 SP1 x64 Ja Review URL: http://codereview.chromium.org/9416052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123447 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base')
-rw-r--r--ui/base/win/ime_input.cc30
1 files changed, 16 insertions, 14 deletions
diff --git a/ui/base/win/ime_input.cc b/ui/base/win/ime_input.cc
index 049ab02..2fa3108 100644
--- a/ui/base/win/ime_input.cc
+++ b/ui/base/win/ime_input.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -191,19 +191,21 @@ void ImeInput::MoveImeWindow(HWND window_handle, HIMC imm_context) {
int x = caret_rect_.x();
int y = caret_rect_.y();
const int kCaretMargin = 1;
- // As written in a comment in ImeInput::CreateImeWindow(),
- // Chinese IMEs ignore function calls to ::ImmSetCandidateWindow()
- // when a user disables TSF (Text Service Framework) and CUAS (Cicero
- // Unaware Application Support).
- // On the other hand, when a user enables TSF and CUAS, Chinese IMEs
- // ignore the position of the current system caret and uses the
- // parameters given to ::ImmSetCandidateWindow() with its 'dwStyle'
- // parameter CFS_CANDIDATEPOS.
- // Therefore, we do not only call ::ImmSetCandidateWindow() but also
- // set the positions of the temporary system caret if it exists.
- CANDIDATEFORM candidate_position = {0, CFS_CANDIDATEPOS, {x, y},
- {0, 0, 0, 0}};
- ::ImmSetCandidateWindow(imm_context, &candidate_position);
+ if (PRIMARYLANGID(input_language_id_) == LANG_CHINESE) {
+ // As written in a comment in ImeInput::CreateImeWindow(),
+ // Chinese IMEs ignore function calls to ::ImmSetCandidateWindow()
+ // when a user disables TSF (Text Service Framework) and CUAS (Cicero
+ // Unaware Application Support).
+ // On the other hand, when a user enables TSF and CUAS, Chinese IMEs
+ // ignore the position of the current system caret and uses the
+ // parameters given to ::ImmSetCandidateWindow() with its 'dwStyle'
+ // parameter CFS_CANDIDATEPOS.
+ // Therefore, we do not only call ::ImmSetCandidateWindow() but also
+ // set the positions of the temporary system caret if it exists.
+ CANDIDATEFORM candidate_position = {0, CFS_CANDIDATEPOS, {x, y},
+ {0, 0, 0, 0}};
+ ::ImmSetCandidateWindow(imm_context, &candidate_position);
+ }
if (system_caret_) {
switch (PRIMARYLANGID(input_language_id_)) {
case LANG_JAPANESE: