Bug 1219215 - part 4: remove dispatching of MozMouseHittest on Windows, r=jimm
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -5304,34 +5304,21 @@ nsWindow::ProcessMessage(UINT msg, WPARA
pos = lParamToClient(lParam);
}
result = DispatchMouseEvent(eContextMenu, wParam, pos, contextMenukey,
contextMenukey ?
WidgetMouseEvent::eLeftButton :
WidgetMouseEvent::eRightButton,
MOUSE_INPUT_SOURCE());
- if (lParam != -1 && !result && mCustomNonClient) {
- bool shouldShowMenu = false;
- if (mDraggableRegion.Contains(GET_X_LPARAM(pos), GET_Y_LPARAM(pos))) {
- shouldShowMenu = true;
- } else {
- WidgetMouseEvent event(true, eMouseHitTest, this,
- WidgetMouseEvent::eReal,
- WidgetMouseEvent::eNormal);
- event.refPoint = LayoutDeviceIntPoint(GET_X_LPARAM(pos), GET_Y_LPARAM(pos));
- event.inputSource = MOUSE_INPUT_SOURCE();
- event.mFlags.mOnlyChromeDispatch = true;
- shouldShowMenu = DispatchWindowEvent(&event);
- }
- if (shouldShowMenu) {
- // Blank area hit, throw up the system menu.
- DisplaySystemMenu(mWnd, mSizeMode, mIsRTL, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
- result = true;
- }
+ if (lParam != -1 && !result && mCustomNonClient &&
+ mDraggableRegion.Contains(GET_X_LPARAM(pos), GET_Y_LPARAM(pos))) {
+ // Blank area hit, throw up the system menu.
+ DisplaySystemMenu(mWnd, mSizeMode, mIsRTL, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
+ result = true;
}
}
break;
case WM_LBUTTONDBLCLK:
result = DispatchMouseEvent(eMouseDoubleClick, wParam,
lParam, false,
WidgetMouseEvent::eLeftButton,
@@ -6006,34 +5993,21 @@ nsWindow::ClientMarginHitTestPoint(int32
}
if (!sIsInMouseCapture && allowContentOverride) {
POINT pt = { mx, my };
::ScreenToClient(mWnd, &pt);
if (pt.x == mCachedHitTestPoint.x && pt.y == mCachedHitTestPoint.y &&
TimeStamp::Now() - mCachedHitTestTime < TimeDuration::FromMilliseconds(HITTEST_CACHE_LIFETIME_MS)) {
return mCachedHitTestResult;
- } else if (mDraggableRegion.Contains(pt.x, pt.y)) {
+ }
+ if (mDraggableRegion.Contains(pt.x, pt.y)) {
testResult = HTCAPTION;
} else {
- WidgetMouseEvent event(true, eMouseHitTest, this,
- WidgetMouseEvent::eReal,
- WidgetMouseEvent::eNormal);
- event.refPoint = LayoutDeviceIntPoint(pt.x, pt.y);
- event.inputSource = MOUSE_INPUT_SOURCE();
- event.mFlags.mOnlyChromeDispatch = true;
- bool result = ConvertStatus(DispatchInputEvent(&event));
- if (result) {
- // The mouse is over a blank area
- testResult = testResult == HTCLIENT ? HTCAPTION : testResult;
- } else {
- // There's content over the mouse pointer. Set HTCLIENT
- // to possibly override a resizer border.
- testResult = HTCLIENT;
- }
+ testResult = HTCLIENT;
}
mCachedHitTestPoint = pt;
mCachedHitTestTime = TimeStamp::Now();
mCachedHitTestResult = testResult;
}
return testResult;
}