diff options
author | suzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-02 03:03:18 +0000 |
---|---|---|
committer | suzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-02 03:03:18 +0000 |
commit | 6f9968865e62cfc75b8c4ce3308837d95967fa21 (patch) | |
tree | cd6ede43f85e017e4f17487323f53c90561a0d5b | |
parent | c2139884d4233899a8d4da66d1bcee2e88c28d42 (diff) | |
download | chromium_src-6f9968865e62cfc75b8c4ce3308837d95967fa21.zip chromium_src-6f9968865e62cfc75b8c4ce3308837d95967fa21.tar.gz chromium_src-6f9968865e62cfc75b8c4ce3308837d95967fa21.tar.bz2 |
[Linux]When cancelling a composition, only focus out/in the IM context when it has focus.
Re-apply: http://codereview.chromium.org/2848036
The last commit was messed up.
BUG=http://crosbug.com/4449
TEST=See bug report.
TBR:satorux@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51485 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/renderer_host/gtk_im_context_wrapper.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/chrome/browser/renderer_host/gtk_im_context_wrapper.cc b/chrome/browser/renderer_host/gtk_im_context_wrapper.cc index 35a6698..8aa7f8c 100644 --- a/chrome/browser/renderer_host/gtk_im_context_wrapper.cc +++ b/chrome/browser/renderer_host/gtk_im_context_wrapper.cc @@ -271,10 +271,12 @@ void GtkIMContextWrapper::CancelComposition() { gtk_im_context_reset(context_); gtk_im_context_reset(context_simple_); - // Some input methods may not honour the reset call. Focusing out/in the - // |context_| to make sure it gets reset correctly. - gtk_im_context_focus_out(context_); - gtk_im_context_focus_in(context_); + if (is_focused_) { + // Some input methods may not honour the reset call. Focusing out/in the + // |context_| to make sure it gets reset correctly. + gtk_im_context_focus_out(context_); + gtk_im_context_focus_in(context_); + } is_composing_text_ = false; preedit_text_.clear(); |