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

Unified Diff: ui/views/win/hwnd_message_handler.cc

Issue 1867953002: This will disable the behavior on Windows 10 in which (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates based on CL feedback. Created 4 years, 8 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 | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 531b4881a52f56d1dfe62604a6999364b81b6fd9..92b4fc2b376dcf23a3bf90eea787668426597ff7 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -1564,6 +1564,29 @@ LRESULT HWNDMessageHandler::OnMouseRange(UINT message,
return HandleMouseEventInternal(message, w_param, l_param, true);
}
+// On some systems with a high-resolution track pad and running Windows 10,
+// using the scrolling gesture (two-finger scroll) on the track pad
+// causes it to also generate a WM_POINTERDOWN message if the window
+// isn't focused. This leads to a WM_POINTERACTIVATE message and the window
+// gaining focus and coming to the front. This code detects a
+// WM_POINTERACTIVATE coming from the track pad and kills the activation
+// of the window. NOTE: most other trackpad messages come in as mouse
+// messages, including WM_MOUSEWHEEL instead of WM_POINTERWHEEL.
+LRESULT HWNDMessageHandler::OnPointerActivate(UINT message,
+ WPARAM w_param,
+ LPARAM l_param) {
+ using GetPointerTypeFn = BOOL(WINAPI*)(UINT32, POINTER_INPUT_TYPE*);
+ UINT32 pointer_id = GET_POINTERID_WPARAM(w_param);
+ POINTER_INPUT_TYPE pointer_type;
+ static GetPointerTypeFn get_pointer_type = reinterpret_cast<GetPointerTypeFn>(
+ GetProcAddress(GetModuleHandleA("user32.dll"), "GetPointerType"));
+ if (get_pointer_type && get_pointer_type(pointer_id, &pointer_type) &&
+ pointer_type == PT_TOUCHPAD)
+ return PA_NOACTIVATE;
+ SetMsgHandled(FALSE);
+ return -1;
+}
+
void HWNDMessageHandler::OnMove(const gfx::Point& point) {
delegate_->HandleMove();
SetMsgHandled(FALSE);
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698