Index: chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.cc |
=================================================================== |
--- chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.cc (revision 266993) |
+++ chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.cc (working copy) |
@@ -99,7 +99,8 @@ |
: delegate_(delegate), |
gtk_context_simple_(NULL), |
gtk_multicontext_(NULL), |
- gtk_context_(NULL) { |
+ gtk_context_(NULL), |
+ gdk_last_set_client_window_(NULL) { |
CHECK(delegate_); |
{ |
@@ -165,7 +166,10 @@ |
} |
// Set the client window and cursor location. |
- gtk_im_context_set_client_window(gtk_context_, event->key.window); |
+ if (event->key.window != gdk_last_set_client_window_) { |
+ gtk_im_context_set_client_window(gtk_context_, event->key.window); |
+ gdk_last_set_client_window_ = event->key.window; |
+ } |
// Convert the last known caret bounds relative to the screen coordinates |
// to a GdkRectangle relative to the client window. |
gint x = 0; |
@@ -195,6 +199,7 @@ |
gtk_im_context_reset(gtk_multicontext_); |
gtk_im_context_focus_out(gtk_context_simple_); |
gtk_im_context_focus_out(gtk_multicontext_); |
+ gdk_last_set_client_window_ = NULL; |
} |
void X11InputMethodContextImplGtk2::OnTextInputTypeChanged( |