summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorsuzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-02 02:29:34 +0000
committersuzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-02 02:29:34 +0000
commit956f9e8439f16ac65bb2689d7a5d36f5363b56bc (patch)
tree60903ef786389496d4ec4ed9da14226659be8161 /chrome/browser
parent99bf6ddc1d1e51204ed73710eb349654205a12ad (diff)
downloadchromium_src-956f9e8439f16ac65bb2689d7a5d36f5363b56bc.zip
chromium_src-956f9e8439f16ac65bb2689d7a5d36f5363b56bc.tar.gz
chromium_src-956f9e8439f16ac65bb2689d7a5d36f5363b56bc.tar.bz2
[Linux]When cancelling a composition, only focus out/in the IM context when it has focus.
BUG=http://crosbug.com/4449 TEST=See bug report. Review URL: http://codereview.chromium.org/2856028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51480 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/renderer_host/gtk_im_context_wrapper.cc10
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();