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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/views/win/hwnd_message_handler.h" 5 #include "ui/views/win/hwnd_message_handler.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 #include <oleacc.h> 8 #include <oleacc.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <tchar.h> 10 #include <tchar.h>
(...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 SetMsgHandled(FALSE); 1557 SetMsgHandled(FALSE);
1558 return MA_ACTIVATE; 1558 return MA_ACTIVATE;
1559 } 1559 }
1560 1560
1561 LRESULT HWNDMessageHandler::OnMouseRange(UINT message, 1561 LRESULT HWNDMessageHandler::OnMouseRange(UINT message,
1562 WPARAM w_param, 1562 WPARAM w_param,
1563 LPARAM l_param) { 1563 LPARAM l_param) {
1564 return HandleMouseEventInternal(message, w_param, l_param, true); 1564 return HandleMouseEventInternal(message, w_param, l_param, true);
1565 } 1565 }
1566 1566
1567 // On some systems with a high-resolution track pad and running Windows 10,
1568 // using the scrolling gesture (two-finger scroll) on the track pad
1569 // causes it to also generate a WM_POINTERDOWN message if the window
1570 // isn't focused. This leads to a WM_POINTERACTIVATE message and the window
1571 // gaining focus and coming to the front. This code detects a
1572 // WM_POINTERACTIVATE coming from the track pad and kills the activation
1573 // of the window. NOTE: most other trackpad messages come in as mouse
1574 // messages, including WM_MOUSEWHEEL instead of WM_POINTERWHEEL.
1575 LRESULT HWNDMessageHandler::OnPointerActivate(UINT message,
1576 WPARAM w_param,
1577 LPARAM l_param) {
1578 using GetPointerTypeFn = BOOL(WINAPI*)(UINT32, POINTER_INPUT_TYPE*);
1579 UINT32 pointer_id = GET_POINTERID_WPARAM(w_param);
1580 POINTER_INPUT_TYPE pointer_type;
1581 static GetPointerTypeFn get_pointer_type = reinterpret_cast<GetPointerTypeFn>(
1582 GetProcAddress(GetModuleHandleA("user32.dll"), "GetPointerType"));
1583 if (get_pointer_type && get_pointer_type(pointer_id, &pointer_type) &&
1584 pointer_type == PT_TOUCHPAD)
1585 return PA_NOACTIVATE;
1586 SetMsgHandled(FALSE);
1587 return -1;
1588 }
1589
1567 void HWNDMessageHandler::OnMove(const gfx::Point& point) { 1590 void HWNDMessageHandler::OnMove(const gfx::Point& point) {
1568 delegate_->HandleMove(); 1591 delegate_->HandleMove();
1569 SetMsgHandled(FALSE); 1592 SetMsgHandled(FALSE);
1570 } 1593 }
1571 1594
1572 void HWNDMessageHandler::OnMoving(UINT param, const RECT* new_bounds) { 1595 void HWNDMessageHandler::OnMoving(UINT param, const RECT* new_bounds) {
1573 delegate_->HandleMove(); 1596 delegate_->HandleMove();
1574 } 1597 }
1575 1598
1576 LRESULT HWNDMessageHandler::OnNCActivate(UINT message, 1599 LRESULT HWNDMessageHandler::OnNCActivate(UINT message,
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after
2629 delegate_->HandleClientSizeChanged(GetClientAreaBounds().size()); 2652 delegate_->HandleClientSizeChanged(GetClientAreaBounds().size());
2630 ResetWindowRegion(false, true); 2653 ResetWindowRegion(false, true);
2631 } 2654 }
2632 2655
2633 if (direct_manipulation_helper_) 2656 if (direct_manipulation_helper_)
2634 direct_manipulation_helper_->SetBounds(bounds_in_pixels); 2657 direct_manipulation_helper_->SetBounds(bounds_in_pixels);
2635 } 2658 }
2636 2659
2637 2660
2638 } // namespace views 2661 } // namespace views
OLDNEW
« 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