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

Side by Side Diff: ui/base/win/mouse_wheel_util.cc

Issue 1261253003: Don't route mouse wheel events to transparent children (Legacy_RenderWidgetHostHWND). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/win/mouse_wheel_util.h" 5 #include "ui/base/win/mouse_wheel_util.h"
6 6
7 #include <windowsx.h> 7 #include <windowsx.h>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "ui/base/view_prop.h" 10 #include "ui/base/view_prop.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } else { 94 } else {
95 // The wheel is scrolling over an unrelated window. Make sure that we 95 // The wheel is scrolling over an unrelated window. Make sure that we
96 // have marked that window as supporting mouse wheel rerouting. 96 // have marked that window as supporting mouse wheel rerouting.
97 // Otherwise, we cannot send random WM_MOUSEWHEEL messages to arbitrary 97 // Otherwise, we cannot send random WM_MOUSEWHEEL messages to arbitrary
98 // windows. So just drop the message. 98 // windows. So just drop the message.
99 if (!WindowSupportsRerouteMouseWheel(window_under_wheel)) 99 if (!WindowSupportsRerouteMouseWheel(window_under_wheel))
100 return true; 100 return true;
101 } 101 }
102 } 102 }
103 103
104 // If the child window is transparent, then it is not interested in
105 // receiving wheel events.
106 if (IsChild(window, window_under_wheel) &&
107 ::GetWindowLong(
108 window_under_wheel, GWL_EXSTYLE) & WS_EX_TRANSPARENT) {
109 return false;
110 }
111
104 // window_under_wheel is a Chrome window. If allowed, redirect. 112 // window_under_wheel is a Chrome window. If allowed, redirect.
105 if (IsCompatibleWithMouseWheelRedirection(window_under_wheel)) { 113 if (IsCompatibleWithMouseWheelRedirection(window_under_wheel)) {
106 base::AutoReset<bool> auto_reset_recursion_break(&recursion_break, true); 114 base::AutoReset<bool> auto_reset_recursion_break(&recursion_break, true);
107 SendMessage(window_under_wheel, WM_MOUSEWHEEL, w_param, l_param); 115 SendMessage(window_under_wheel, WM_MOUSEWHEEL, w_param, l_param);
108 return true; 116 return true;
109 } 117 }
110 // If redirection is disallowed, try the parent. 118 // If redirection is disallowed, try the parent.
111 window_under_wheel = GetAncestor(window_under_wheel, GA_PARENT); 119 window_under_wheel = GetAncestor(window_under_wheel, GA_PARENT);
112 } 120 }
113 // If we traversed back to the starting point, we should process 121 // If we traversed back to the starting point, we should process
114 // this message normally; return false. 122 // this message normally; return false.
115 return false; 123 return false;
116 } 124 }
117 125
118 } // namespace ui 126 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698