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

Side by Side Diff: ui/base/ime/input_method_auralinux.cc

Issue 1566083002: Makes sure the keyboard typing isn't blocked when InputMethod::OnFocus() is not correctly called. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | ui/base/ime/input_method_win.cc » ('j') | ui/base/ime/input_method_win.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/base/ime/input_method_auralinux.h" 5 #include "ui/base/ime/input_method_auralinux.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "ui/base/ime/linux/linux_input_method_context_factory.h" 9 #include "ui/base/ime/linux/linux_input_method_context_factory.h"
10 #include "ui/base/ime/text_input_client.h" 10 #include "ui/base/ime/text_input_client.h"
(...skipping 28 matching lines...) Expand all
39 39
40 bool InputMethodAuraLinux::OnUntranslatedIMEMessage( 40 bool InputMethodAuraLinux::OnUntranslatedIMEMessage(
41 const base::NativeEvent& event, 41 const base::NativeEvent& event,
42 NativeEventResult* result) { 42 NativeEventResult* result) {
43 return false; 43 return false;
44 } 44 }
45 45
46 void InputMethodAuraLinux::DispatchKeyEvent(ui::KeyEvent* event) { 46 void InputMethodAuraLinux::DispatchKeyEvent(ui::KeyEvent* event) {
47 DCHECK(event->type() == ET_KEY_PRESSED || event->type() == ET_KEY_RELEASED); 47 DCHECK(event->type() == ET_KEY_PRESSED || event->type() == ET_KEY_RELEASED);
48 DCHECK(system_toplevel_window_focused()); 48 DCHECK(system_toplevel_window_focused());
49 if (!system_toplevel_window_focused()) {
50 LOG(ERROR) <<
51 "Key event got without the top-level window being activated.";
sky 2016/01/07 16:24:42 Under what conditions does this happen? It seems l
Shu Chen 2016/01/08 02:04:11 Yes, exactly. crbug.com/569339 causes a lot of com
yukawa 2016/01/08 02:21:20 My understanding is the same to what Shu explained
52 // There are random issues that the keyboard typing doesn't work.
53 // The root cause might be the InputMethod::OnFocus() is not correctly
54 // called when the top-level window is activated
55 // (in DNWA::HandleActivationChanged).
56 // Calls OnFocus here to unblock the keyboard typing.
57 OnFocus();
58 }
49 59
50 // If no text input client, do nothing. 60 // If no text input client, do nothing.
51 if (!GetTextInputClient()) { 61 if (!GetTextInputClient()) {
52 ignore_result(DispatchKeyEventPostIME(event)); 62 ignore_result(DispatchKeyEventPostIME(event));
53 return; 63 return;
54 } 64 }
55 65
56 suppress_next_result_ = false; 66 suppress_next_result_ = false;
57 composition_changed_ = false; 67 composition_changed_ = false;
58 result_text_.clear(); 68 result_text_.clear();
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 369
360 void InputMethodAuraLinux::ConfirmCompositionText() { 370 void InputMethodAuraLinux::ConfirmCompositionText() {
361 TextInputClient* client = GetTextInputClient(); 371 TextInputClient* client = GetTextInputClient();
362 if (client && client->HasCompositionText()) 372 if (client && client->HasCompositionText())
363 client->ConfirmCompositionText(); 373 client->ConfirmCompositionText();
364 374
365 ResetContext(); 375 ResetContext();
366 } 376 }
367 377
368 } // namespace ui 378 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/base/ime/input_method_win.cc » ('j') | ui/base/ime/input_method_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698