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

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

Issue 159713012: Don't track mouse events in HWNDMessageHandler when they are forwarded by the LegacyRenderWidgetHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 10 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
« ui/views/controls/menu/menu_controller.cc ('K') | « ui/views/event_utils_aura.cc ('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
===================================================================
--- ui/views/win/hwnd_message_handler.cc (revision 250790)
+++ ui/views/win/hwnd_message_handler.cc (working copy)
@@ -1022,6 +1022,10 @@
// clear restore_focus_when_enabled_.
restore_focus_when_enabled_ = false;
delegate_->SaveFocusOnDeactivate();
+ // When we lose activation send a dummy WM_MOUSELEAVE message. This is to
+ // handle cases when we don't track certain WM_MOUSEMOVE messages like those
+ // coming from a child.
+ ::PostMessage(hwnd(), WM_MOUSELEAVE, 0, 0);
sky 2014/02/12 22:51:29 If the legacy hwnd starts tracking mouse events, i
ananta 2014/02/12 23:17:08 When it does. The TrackMouseEvent API succeeds on
} else {
// We must restore the focus after the message has been DefProc'ed as it
// does set the focus to the last focused HWND.
@@ -1628,7 +1632,6 @@
// be WM_RBUTTONUP instead of WM_NCRBUTTONUP.
SetCapture();
}
-
MSG msg = { hwnd(), message, w_param, l_param, GetMessageTime(),
{ CR_GET_X_LPARAM(l_param), CR_GET_Y_LPARAM(l_param) } };
ui::MouseEvent event(msg);
@@ -1638,7 +1641,8 @@
if (!(event.flags() & ui::EF_IS_NON_CLIENT))
delegate_->HandleTooltipMouseMove(message, w_param, l_param);
- if (event.type() == ui::ET_MOUSE_MOVED && !HasCapture()) {
+ if (event.type() == ui::ET_MOUSE_MOVED && !HasCapture() &&
+ HIWORD(w_param) != SPECIAL_MOUSEMOVE_NOT_TO_BE_TRACKED) {
sky 2014/02/12 22:51:29 Does this imply we need to track mouse mouse event
ananta 2014/02/12 23:17:08 When the mouse leaves the bounds of the child we w
// Windows only fires WM_MOUSELEAVE events if the application begins
// "tracking" mouse events for a given HWND during WM_MOUSEMOVE events.
// We need to call |TrackMouseEvents| to listen for WM_MOUSELEAVE.
« ui/views/controls/menu/menu_controller.cc ('K') | « ui/views/event_utils_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698