Chromium Code Reviews| 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. |