Skip to content

Commit

Permalink
Return HTCLIENT from the WM_NCHITTEST message handler in the LegacyRe…
Browse files Browse the repository at this point in the history
…nderWidgetHostHWND class

if the parent returns HTNOWHERE

The parent can return HTNOWHERE in its WM_NCHITTEST handler if it is a popup window. For e.g.
a select box, etc. The LegacyRenderWidgetHostHWND should return HTCLIENT in this case to
ensure that we don't get HTVSCROLL/HTHSCROLL being returned via DefWindowProc. This could
happen because the fake scroll styles are present on the window.

We have similar code in the HWNDMessageHandler::OnNCHitTest function which was added as part
of the recent scroll fixes. This needs to be needs to be done in the LegacyRenderWidgetHostHWND class now
as all scroll fixes are being consolidated here.

BUG=347431, 335941
R=cpu@chromium.org, sky@chromium.org, cpu

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253930 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
ananta@chromium.org committed Feb 27, 2014
1 parent 3242279 commit dbd158f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ LRESULT LegacyRenderWidgetHostHWND::OnNCHitTest(UINT message,
LRESULT hit_test = GetWindowEventTarget(
GetParent())->HandleNcHitTestMessage(message, w_param, l_param);
// If the parent returns HTNOWHERE which can happen for popup windows, etc
// allow the default handling to go through.
// we return HTCLIENT.
if (hit_test == HTNOWHERE)
SetMsgHandled(FALSE);
hit_test = HTCLIENT;
return hit_test;
}
return HTNOWHERE;
Expand Down

0 comments on commit dbd158f

Please sign in to comment.