Commit 26f74847 authored by ananta@chromium.org's avatar ananta@chromium.org

We should not be sending a WM_MOUSELEAVE to the parent from the...

We should not be sending a WM_MOUSELEAVE to the parent from the LegacyRenderWidgetHostHWND class when the parent has capture.

The LegacyRenderWidgetHostHWND class tracks WM_MOUSEMOVES to inform the parent when the mouse cursor moves outside the
bounds of the parent window. When the parent sets capture, Windows sends us a WM_MOUSELEAVE message. We should be ignoring this.

BUG=343844
R=sky@chromium.org
TBR=cpu

Review URL: https://codereview.chromium.org/166163004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251370 0039d316-1c4b-4281-b951-d872f2087c98
parent e3c30dd8
......@@ -171,12 +171,14 @@ LRESULT LegacyRenderWidgetHostHWND::OnMouseLeave(UINT message,
WPARAM w_param,
LPARAM l_param) {
mouse_tracking_enabled_ = false;
// We should send a WM_MOUSELEAVE to the parent window only if the mouse has
// moved outside the bounds of the parent.
POINT cursor_pos;
::GetCursorPos(&cursor_pos);
if (::WindowFromPoint(cursor_pos) != GetParent())
return ::SendMessage(GetParent(), message, w_param, l_param);
if (GetCapture() != GetParent()) {
// We should send a WM_MOUSELEAVE to the parent window only if the mouse
// has moved outside the bounds of the parent.
POINT cursor_pos;
::GetCursorPos(&cursor_pos);
if (::WindowFromPoint(cursor_pos) != GetParent())
return ::SendMessage(GetParent(), message, w_param, l_param);
}
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment