Chromium Code Reviews| Index: ui/base/ime/input_method_win.cc |
| diff --git a/ui/base/ime/input_method_win.cc b/ui/base/ime/input_method_win.cc |
| index 56bbac1b3244b1618eeaa89001155b815223cdf6..5475570f71908564966b03a5c26343dfef7a3fc3 100644 |
| --- a/ui/base/ime/input_method_win.cc |
| +++ b/ui/base/ime/input_method_win.cc |
| @@ -262,6 +262,22 @@ LRESULT InputMethodWin::OnChar(HWND window_handle, |
| BOOL* handled) { |
| *handled = TRUE; |
| + if (!system_toplevel_window_focused()) { |
| + LOG(ERROR) |
|
eroman
2016/01/13 22:27:08
Are these messages you want dumped?
Shu Chen
2016/01/14 07:44:47
Done.
|
| + << "Char message got without the top-level window being activated."; |
| + LOG(ERROR) << "Window focused: " |
| + << (::GetActiveWindow() == toplevel_window_handle_); |
| + GetLogCollector()->DumpLogs(); |
| + // There are random issues that the keyboard typing doesn't work. |
| + // The root cause might be the InputMethod::OnFocus() is not correctly |
| + // called when the top-level window is activated |
| + // (in DNWA::HandleActivationChanged). |
| + // Calls OnFocus here to unblock the keyboard typing. |
| + OnFocus(); |
| + } else { |
| + GetLogCollector()->ClearLogs(); |
| + } |
| + |
| // We need to send character events to the focused text input client event if |
| // its text input type is ui::TEXT_INPUT_TYPE_NONE. |
| if (GetTextInputClient()) { |
| @@ -295,6 +311,7 @@ LRESULT InputMethodWin::OnImeSetContext(HWND window_handle, |
| WPARAM wparam, |
| LPARAM lparam, |
| BOOL* handled) { |
| + GetLogCollector()->AddLog("WM_IME_SETCONTEXT"); |
| if (!!wparam) { |
| imm32_manager_.CreateImeWindow(window_handle); |
| if (system_toplevel_window_focused()) { |