Backed out changeset 0930049c0ca9 (Bug 1534389) due to causing bug 1551961. a=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sat, 15 Jun 2019 11:51:49 +0200
changeset 536974 a526d11a775d765112d0373373b667062aef4ed8
parent 536973 6d6e29d75fbf40ff805e80bf73491a8a13944f3b
child 536975 5656744772ecc4144391a76686b526be5a6e04d5
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1534389, 1551961
milestone68.0
backs out0930049c0ca984c909d11ba2853ef6d96e43e242
Backed out changeset 0930049c0ca9 (Bug 1534389) due to causing bug 1551961. a=backout
widget/windows/nsWindow.cpp
widget/windows/nsWindow.h
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -589,17 +589,16 @@ nsWindow::nsWindow(bool aIsChildWindow)
   mUnicodeWidget = true;
   mDisplayPanFeedback = false;
   mTouchWindow = false;
   mFutureMarginsToUse = false;
   mCustomNonClient = false;
   mHideChrome = false;
   mFullscreenMode = false;
   mMousePresent = false;
-  mMouseInDraggableArea = false;
   mDestroyCalled = false;
   mIsEarlyBlankWindow = false;
   mHasTaskbarIconBeenCreated = false;
   mMouseTransparent = false;
   mPickerDisplayCount = 0;
   mWindowType = eWindowType_child;
   mBorderStyle = eBorderStyle_default;
   mOldSizeMode = nsSizeMode_Normal;
@@ -5307,20 +5306,16 @@ bool nsWindow::ProcessMessage(UINT msg, 
     case WM_ERASEBKGND:
       if (!AutoErase((HDC)wParam)) {
         *aRetValue = 1;
         result = true;
       }
       break;
 
     case WM_MOUSEMOVE: {
-      LPARAM lParamScreen = lParamToScreen(lParam);
-      mMouseInDraggableArea = WithinDraggableRegion(GET_X_LPARAM(lParamScreen),
-                                                    GET_Y_LPARAM(lParamScreen));
-
       if (!mMousePresent && !sIsInMouseCapture) {
         // First MOUSEMOVE over the client area. Ask for MOUSELEAVE
         TRACKMOUSEEVENT mTrack;
         mTrack.cbSize = sizeof(TRACKMOUSEEVENT);
         mTrack.dwFlags = TME_LEAVE;
         mTrack.dwHoverTime = 0;
         mTrack.hwndTrack = mWnd;
         TrackMouseEvent(&mTrack);
@@ -5342,28 +5337,24 @@ bool nsWindow::ProcessMessage(UINT msg, 
           DispatchMouseEvent(eMouseMove, wParam, lParam, false,
                              MouseButton::eLeft, MOUSE_INPUT_SOURCE(),
                              mPointerEvents.GetCachedPointerInfo(msg, wParam));
       if (userMovedMouse) {
         DispatchPendingEvents();
       }
     } break;
 
-    case WM_NCMOUSEMOVE: {
-      LPARAM lParamClient = lParamToClient(lParam);
-      if (WithinDraggableRegion(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))) {
-        // If we noticed the mouse moving in our draggable region, forward the
-        // message as a normal WM_MOUSEMOVE.
-        SendMessage(mWnd, WM_MOUSEMOVE, 0, lParamClient);
-      } else if (mMousePresent && !sIsInMouseCapture) {
+    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)
         // If we receive a mouse move event on non-client chrome, make sure and
         // send an eMouseExitFromWidget event as well.
         SendMessage(mWnd, WM_MOUSELEAVE, 0, 0);
-      }
-    } break;
+      break;
 
     case WM_LBUTTONDOWN: {
       result =
           DispatchMouseEvent(eMouseDown, wParam, lParam, false,
                              MouseButton::eLeft, MOUSE_INPUT_SOURCE(),
                              mPointerEvents.GetCachedPointerInfo(msg, wParam));
       DispatchPendingEvents();
     } break;
@@ -5373,17 +5364,16 @@ bool nsWindow::ProcessMessage(UINT msg, 
           DispatchMouseEvent(eMouseUp, wParam, lParam, false,
                              MouseButton::eLeft, MOUSE_INPUT_SOURCE(),
                              mPointerEvents.GetCachedPointerInfo(msg, wParam));
       DispatchPendingEvents();
     } break;
 
     case WM_MOUSELEAVE: {
       if (!mMousePresent) break;
-      if (mMouseInDraggableArea) break;
       mMousePresent = false;
 
       // Check if the mouse is over the fullscreen transition window, if so
       // clear sLastMouseMovePoint. This way the WM_MOUSEMOVE we get after the
       // transition window disappears will not be ignored, even if the mouse
       // hasn't moved.
       if (mTransitionWnd && WindowAtMouse() == mTransitionWnd) {
         sLastMouseMovePoint = {0};
@@ -6179,20 +6169,16 @@ int32_t nsWindow::ClientMarginHitTestPoi
       testResult = HTCLIENT;
     }
     mCachedHitTestResult = testResult;
   }
 
   return testResult;
 }
 
-bool nsWindow::WithinDraggableRegion(int32_t screenX, int32_t screenY) {
-  return ClientMarginHitTestPoint(screenX, screenY) == HTCAPTION;
-}
-
 TimeStamp nsWindow::GetMessageTimeStamp(LONG aEventTime) const {
   CurrentWindowsTimeGetter getCurrentTime(mWnd);
   return TimeConverter().GetTimeStampFromSystemTime(aEventTime, getCurrentTime);
 }
 
 void nsWindow::PostSleepWakeNotification(const bool aIsSleepMode) {
   if (aIsSleepMode == gIsSleepMode) return;
 
--- a/widget/windows/nsWindow.h
+++ b/widget/windows/nsWindow.h
@@ -479,17 +479,16 @@ class nsWindow final : public nsWindowBa
    */
 #ifdef MOZ_XUL
  private:
   void SetWindowTranslucencyInner(nsTransparencyMode aMode);
   nsTransparencyMode GetWindowTranslucencyInner() const {
     return mTransparencyMode;
   }
   void UpdateGlass();
-  bool WithinDraggableRegion(int32_t clientX, int32_t clientY);
 
  protected:
 #endif  // MOZ_XUL
 
   static bool IsAsyncResponseEvent(UINT aMsg, LRESULT& aResult);
   void IPCWindowProcHandler(UINT& msg, WPARAM& wParam, LPARAM& lParam);
 
   /**
@@ -545,17 +544,16 @@ class nsWindow final : public nsWindowBa
   bool mUnicodeWidget;
   bool mPainting;
   bool mTouchWindow;
   bool mDisplayPanFeedback;
   bool mHideChrome;
   bool mIsRTL;
   bool mFullscreenMode;
   bool mMousePresent;
-  bool mMouseInDraggableArea;
   bool mDestroyCalled;
   bool mOpeningAnimationSuppressed;
   bool mAlwaysOnTop;
   bool mIsEarlyBlankWindow;
   uint32_t mBlurSuppressLevel;
   DWORD_PTR mOldStyle;
   DWORD_PTR mOldExStyle;
   nsNativeDragTarget* mNativeDragTarget;
@@ -659,28 +657,27 @@ class nsWindow final : public nsWindowBa
   bool mMouseTransparent;
 
   // Whether we're in the process of sending a WM_SETTEXT ourselves
   bool mSendingSetText;
 
   // Whether we we're created as a child window (aka ChildWindow) or not.
   bool mIsChildWindow : 1;
 
-  int32_t 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;
 
   // The location of the window buttons in the window.
   mozilla::Maybe<LayoutDeviceIntRect> mWindowButtonsRect;
 
   // Caching for hit test results
   POINT mCachedHitTestPoint;
   TimeStamp mCachedHitTestTime;
+  int32_t mCachedHitTestResult;
 
   RefPtr<mozilla::widget::WinCompositorWidget> mBasicLayersSurface;
 
   static bool sNeedsToInitMouseWheelSettings;
   static void InitMouseWheelScrollData();
 
   double mSizeConstraintsScale;  // scale in effect when setting constraints