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

Unified Diff: ui/views/win/hwnd_message_handler.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: remote_input_method_win.cc is gone again. 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/win/hwnd_message_handler.cc
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 0cacffe4a76dfdde167943bf1f232f87736b9a76..d5e972a9e0b1edc1cf2da8e6bc639fda0d1097df 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -928,8 +928,12 @@ LRESULT HWNDMessageHandler::OnWndProc(UINT message,
delegate_->HandleDestroyed();
}
- if (message == WM_ACTIVATE && IsTopLevelWindow(window))
- PostProcessActivateMessage(LOWORD(w_param), !!HIWORD(w_param));
+ if (message == WM_ACTIVATE) {
+ if (IsTopLevelWindow(window))
+ PostProcessActivateMessage(LOWORD(w_param), !!HIWORD(w_param));
+ else
+ delegate_->AddStringLog("WM_ACTIVATE on non-top-level window.");
+ }
return result;
}
@@ -1033,6 +1037,8 @@ void HWNDMessageHandler::PostProcessActivateMessage(int activation_state,
const bool active = activation_state != WA_INACTIVE && !minimized;
if (delegate_->CanActivate())
delegate_->HandleActivationChanged(active);
+ else
+ delegate_->AddStringLog("Missing call to HandleActivationChanged.");
}
void HWNDMessageHandler::RestoreEnabledIfNecessary() {
@@ -1231,6 +1237,8 @@ void HWNDMessageHandler::ForceRedrawWindow(int attempts) {
// Message handlers ------------------------------------------------------------
void HWNDMessageHandler::OnActivateApp(BOOL active, DWORD thread_id) {
+ delegate_->AddStringLog("WM_ACTIVATEAPP: ");
+ delegate_->AddBooleanLog(active ? true : false);
if (delegate_->IsWidgetWindow() && !active &&
thread_id != GetCurrentThreadId()) {
delegate_->HandleAppDeactivated();
@@ -1486,6 +1494,8 @@ void HWNDMessageHandler::OnInputLangChange(DWORD character_set,
LRESULT HWNDMessageHandler::OnKeyEvent(UINT message,
WPARAM w_param,
LPARAM l_param) {
+ if (message == WM_KEYDOWN || message == WM_SYSKEYDOWN)
+ delegate_->AddStringLog("WM_KEYDOWN || WM_SYSKEYDOWN");
MSG msg = {
hwnd(), message, w_param, l_param, static_cast<DWORD>(GetMessageTime())};
ui::KeyEvent key(msg);
@@ -1503,6 +1513,7 @@ void HWNDMessageHandler::OnKillFocus(HWND focused_window) {
LRESULT HWNDMessageHandler::OnMouseActivate(UINT message,
WPARAM w_param,
LPARAM l_param) {
+ delegate_->AddStringLog("WM_MOUSEACTIVATE");
// Please refer to the comments in the header for the touch_down_contexts_
// member for the if statement below.
if (touch_down_contexts_)
@@ -1567,6 +1578,8 @@ void HWNDMessageHandler::OnMoving(UINT param, const RECT* new_bounds) {
LRESULT HWNDMessageHandler::OnNCActivate(UINT message,
WPARAM w_param,
LPARAM l_param) {
+ delegate_->AddStringLog("WM_NCACTIVATE: ");
+ delegate_->AddBooleanLog(w_param ? true : false);
// Per MSDN, w_param is either TRUE or FALSE. However, MSDN also hints that:
// "If the window is minimized when this message is received, the application
// should pass the message to the DefWindowProc function."
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ('k') | ui/views/win/hwnd_message_handler_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698