зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset c26e947b78c2 (bug 1534389) for test_bug1298970.html failures CLOSED TREE
This commit is contained in:
Родитель
619ed1e77e
Коммит
c01b9ab9c9
|
@ -593,7 +593,6 @@ nsWindow::nsWindow(bool aIsChildWindow)
|
|||
mHideChrome = false;
|
||||
mFullscreenMode = false;
|
||||
mMousePresent = false;
|
||||
mMouseInDraggableArea = false;
|
||||
mDestroyCalled = false;
|
||||
mIsEarlyBlankWindow = false;
|
||||
mHasTaskbarIconBeenCreated = false;
|
||||
|
@ -614,7 +613,7 @@ nsWindow::nsWindow(bool aIsChildWindow)
|
|||
mCachedHitTestPoint.x = 0;
|
||||
mCachedHitTestPoint.y = 0;
|
||||
mCachedHitTestTime = TimeStamp::Now();
|
||||
mCachedHitTestResult = false;
|
||||
mCachedHitTestResult = 0;
|
||||
#ifdef MOZ_XUL
|
||||
mTransparencyMode = eTransparencyOpaque;
|
||||
memset(&mGlassMargins, 0, sizeof mGlassMargins);
|
||||
|
@ -5310,8 +5309,6 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
|
|||
break;
|
||||
|
||||
case WM_MOUSEMOVE: {
|
||||
mMouseInDraggableArea =
|
||||
WithinDraggableRegion(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
|
||||
if (!mMousePresent && !sIsInMouseCapture) {
|
||||
// First MOUSEMOVE over the client area. Ask for MOUSELEAVE
|
||||
TRACKMOUSEEVENT mTrack;
|
||||
|
@ -5344,19 +5341,12 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
|
|||
}
|
||||
} break;
|
||||
|
||||
case WM_NCMOUSEMOVE: {
|
||||
LPARAM lParamClient = lParamToClient(lParam);
|
||||
if (WithinDraggableRegion(GET_X_LPARAM(lParamClient),
|
||||
GET_Y_LPARAM(lParamClient))) {
|
||||
// If we noticed the mouse moving in our draggable region, forward the
|
||||
// message as a normal WM_MOUSEMOVE.
|
||||
SendMessage(mWnd, WM_MOUSEMOVE, wParam, lParamClient);
|
||||
} else if (mMousePresent && !sIsInMouseCapture) {
|
||||
// If we receive a mouse move event on non-client chrome, make sure and
|
||||
// send an eMouseExitFromWidget event as well.
|
||||
case WM_NCMOUSEMOVE:
|
||||
// If we receive a mouse move event on non-client chrome, make sure and
|
||||
// send an eMouseExitFromWidget event as well.
|
||||
if (mMousePresent && !sIsInMouseCapture)
|
||||
SendMessage(mWnd, WM_MOUSELEAVE, 0, 0);
|
||||
}
|
||||
} break;
|
||||
break;
|
||||
|
||||
case WM_LBUTTONDOWN: {
|
||||
result = DispatchMouseEvent(
|
||||
|
@ -5376,7 +5366,6 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
|
|||
|
||||
case WM_MOUSELEAVE: {
|
||||
if (!mMousePresent) break;
|
||||
if (mMouseInDraggableArea) break;
|
||||
mMousePresent = false;
|
||||
|
||||
// Check if the mouse is over the fullscreen transition window, if so
|
||||
|
@ -6172,29 +6161,24 @@ int32_t nsWindow::ClientMarginHitTestPoint(int32_t mx, int32_t my) {
|
|||
if (!sIsInMouseCapture && allowContentOverride) {
|
||||
POINT pt = {mx, my};
|
||||
::ScreenToClient(mWnd, &pt);
|
||||
if (WithinDraggableRegion(pt.x, pt.y)) {
|
||||
if (pt.x == mCachedHitTestPoint.x && pt.y == mCachedHitTestPoint.y &&
|
||||
TimeStamp::Now() - mCachedHitTestTime <
|
||||
TimeDuration::FromMilliseconds(HITTEST_CACHE_LIFETIME_MS)) {
|
||||
return mCachedHitTestResult;
|
||||
}
|
||||
if (mDraggableRegion.Contains(pt.x, pt.y)) {
|
||||
testResult = HTCAPTION;
|
||||
} else {
|
||||
testResult = HTCLIENT;
|
||||
}
|
||||
mCachedHitTestPoint = pt;
|
||||
mCachedHitTestTime = TimeStamp::Now();
|
||||
mCachedHitTestResult = testResult;
|
||||
}
|
||||
|
||||
return testResult;
|
||||
}
|
||||
|
||||
bool nsWindow::WithinDraggableRegion(int32_t clientX, int32_t clientY) {
|
||||
if (clientX == mCachedHitTestPoint.x && clientY == mCachedHitTestPoint.y &&
|
||||
TimeStamp::Now() - mCachedHitTestTime <
|
||||
TimeDuration::FromMilliseconds(HITTEST_CACHE_LIFETIME_MS)) {
|
||||
return mCachedHitTestResult;
|
||||
}
|
||||
mCachedHitTestPoint = {clientX, clientY};
|
||||
mCachedHitTestTime = TimeStamp::Now();
|
||||
|
||||
mCachedHitTestResult = mDraggableRegion.Contains(clientX, clientY);
|
||||
return mCachedHitTestResult;
|
||||
}
|
||||
|
||||
TimeStamp nsWindow::GetMessageTimeStamp(LONG aEventTime) const {
|
||||
CurrentWindowsTimeGetter getCurrentTime(mWnd);
|
||||
return TimeConverter().GetTimeStampFromSystemTime(aEventTime, getCurrentTime);
|
||||
|
|
|
@ -484,7 +484,6 @@ class nsWindow final : public nsWindowBase {
|
|||
return mTransparencyMode;
|
||||
}
|
||||
void UpdateGlass();
|
||||
bool WithinDraggableRegion(int32_t clientX, int32_t clientY);
|
||||
|
||||
protected:
|
||||
#endif // MOZ_XUL
|
||||
|
@ -550,7 +549,6 @@ class nsWindow final : public nsWindowBase {
|
|||
bool mIsRTL;
|
||||
bool mFullscreenMode;
|
||||
bool mMousePresent;
|
||||
bool mMouseInDraggableArea;
|
||||
bool mDestroyCalled;
|
||||
bool mOpeningAnimationSuppressed;
|
||||
bool mAlwaysOnTop;
|
||||
|
@ -664,8 +662,6 @@ class nsWindow final : public nsWindowBase {
|
|||
// Whether we we're created as a child window (aka ChildWindow) or not.
|
||||
bool mIsChildWindow : 1;
|
||||
|
||||
bool mCachedHitTestResult;
|
||||
|
||||
// The point in time at which the last paint completed. We use this to avoid
|
||||
// painting too rapidly in response to frequent input events.
|
||||
TimeStamp mLastPaintEndTime;
|
||||
|
@ -676,6 +672,7 @@ class nsWindow final : public nsWindowBase {
|
|||
// Caching for hit test results
|
||||
POINT mCachedHitTestPoint;
|
||||
TimeStamp mCachedHitTestTime;
|
||||
int32_t mCachedHitTestResult;
|
||||
|
||||
RefPtr<mozilla::widget::WinCompositorWidget> mBasicLayersSurface;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче