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

Side by Side Diff: views/widget/native_widget_gtk.cc

Issue 7746005: Focus fix. InputMethod needs to be initialized before calling OnFocus (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | views/widget/native_widget_views.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "views/widget/native_widget_gtk.h" 5 #include "views/widget/native_widget_gtk.h"
6 6
7 #include <gdk/gdk.h> 7 #include <gdk/gdk.h>
8 #include <gdk/gdkx.h> 8 #include <gdk/gdkx.h>
9 #include <X11/extensions/shape.h> 9 #include <X11/extensions/shape.h>
10 #include <X11/Xatom.h> 10 #include <X11/Xatom.h>
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 // RenderWidgetHostViewViews in normal ChromeOS. 966 // RenderWidgetHostViewViews in normal ChromeOS.
967 if (views::Widget::IsPureViews()) { 967 if (views::Widget::IsPureViews()) {
968 #if defined(HAVE_IBUS) 968 #if defined(HAVE_IBUS)
969 InputMethod* input_method = 969 InputMethod* input_method =
970 InputMethodIBus::IsInputMethodIBusEnabled() ? 970 InputMethodIBus::IsInputMethodIBusEnabled() ?
971 static_cast<InputMethod*>(new InputMethodIBus(this)) : 971 static_cast<InputMethod*>(new InputMethodIBus(this)) :
972 static_cast<InputMethod*>(new InputMethodGtk(this)); 972 static_cast<InputMethod*>(new InputMethodGtk(this));
973 #else 973 #else
974 InputMethod* input_method = new InputMethodGtk(this); 974 InputMethod* input_method = new InputMethodGtk(this);
975 #endif 975 #endif
976 input_method->Init(GetWidget());
976 if (has_focus_) 977 if (has_focus_)
977 input_method->OnFocus(); 978 input_method->OnFocus();
978 return input_method; 979 return input_method;
979 } 980 }
980 // GTK's textfield handles IME. 981 // GTK's textfield handles IME.
981 return NULL; 982 return NULL;
982 } 983 }
983 984
984 void NativeWidgetGtk::CenterWindow(const gfx::Size& size) { 985 void NativeWidgetGtk::CenterWindow(const gfx::Size& size) {
985 gfx::Rect center_rect; 986 gfx::Rect center_rect;
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
2244 button_pressed = event->type == GDK_BUTTON_PRESS || 2245 button_pressed = event->type == GDK_BUTTON_PRESS ||
2245 event->type == GDK_2BUTTON_PRESS || 2246 event->type == GDK_2BUTTON_PRESS ||
2246 event->type == GDK_3BUTTON_PRESS; 2247 event->type == GDK_3BUTTON_PRESS;
2247 gdk_event_free(event); 2248 gdk_event_free(event);
2248 } 2249 }
2249 return button_pressed; 2250 return button_pressed;
2250 } 2251 }
2251 2252
2252 } // namespace internal 2253 } // namespace internal
2253 } // namespace views 2254 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | views/widget/native_widget_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698