Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(955)

Unified Diff: views/widget/native_widget_gtk.cc

Issue 7729007: Focus/InputMethod fix. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | views/widget/widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/native_widget_gtk.cc
diff --git a/views/widget/native_widget_gtk.cc b/views/widget/native_widget_gtk.cc
index 8081a31784e708ddd4a681d4106a7bd748ff86a8..b2a4342c383304b94eb55cc327308bfea67ee5b4 100644
--- a/views/widget/native_widget_gtk.cc
+++ b/views/widget/native_widget_gtk.cc
@@ -966,12 +966,16 @@ InputMethod* NativeWidgetGtk::CreateInputMethod() {
// RenderWidgetHostViewViews in normal ChromeOS.
if (views::Widget::IsPureViews()) {
#if defined(HAVE_IBUS)
- return InputMethodIBus::IsInputMethodIBusEnabled() ?
+ InputMethod* input_method =
+ InputMethodIBus::IsInputMethodIBusEnabled() ?
static_cast<InputMethod*>(new InputMethodIBus(this)) :
static_cast<InputMethod*>(new InputMethodGtk(this));
#else
- return new InputMethodGtk(this);
+ InputMethod* input_method = new InputMethodGtk(this);
#endif
+ if (has_focus_)
+ input_method->OnFocus();
+ return input_method;
}
// GTK's textfield handles IME.
return NULL;
@@ -1658,7 +1662,7 @@ gboolean NativeWidgetGtk::OnFocusOut(GtkWidget* widget, GdkEventFocus* event) {
return false; // This is the second focus-out event in a row, ignore it.
has_focus_ = false;
- if (GetWidget()->is_top_level())
+ if (!GetWidget()->is_top_level())
return false;
// Only top-level Widget should have an InputMethod instance.
« no previous file with comments | « no previous file | views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698