Back out 50f2a49570ce (bug 1085027) on suspicion of making Win7 opt mochitest-4 permaorange, a=backout
authorPhil Ringnalda <philringnalda@gmail.com>
Tue, 21 Oct 2014 23:04:42 -0700
changeset 211618 ae4d9b4ff2eedc2a22aa3799cb53680c5a016100
parent 211617 4c449dcda4534861538325bee2b78325bcd7efd3
child 211619 305d24174ace182dcca3d14027bb08d2d7ef477a
child 211666 333d512a000d6766ff1eafec2ceb2f1187048a60
child 211793 433f3531e45dc99b2d47c2d3cd5c687304dfd03c
push id27684
push userphilringnalda@gmail.com
push dateWed, 22 Oct 2014 06:05:00 +0000
treeherdermozilla-central@ae4d9b4ff2ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1085027
milestone36.0a1
backs out50f2a49570ce90754ac341b219dbb615bd382322
first release with
nightly linux32
ae4d9b4ff2ee / 36.0a1 / 20141022030202 / files
nightly linux64
ae4d9b4ff2ee / 36.0a1 / 20141022030202 / files
nightly mac
ae4d9b4ff2ee / 36.0a1 / 20141022030202 / files
nightly win32
ae4d9b4ff2ee / 36.0a1 / 20141022030202 / files
nightly win64
ae4d9b4ff2ee / 36.0a1 / 20141022030202 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Back out 50f2a49570ce (bug 1085027) on suspicion of making Win7 opt mochitest-4 permaorange, a=backout CLOSED TREE
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -3127,22 +3127,30 @@ NS_METHOD nsWindow::EnableDragDrop(bool 
  * SECTION: nsIWidget::CaptureMouse
  *
  * Enables/Disables system mouse capture.
  *
  **************************************************************/
 
 NS_METHOD nsWindow::CaptureMouse(bool aCapture)
 {
+  TRACKMOUSEEVENT mTrack;
+  mTrack.cbSize = sizeof(TRACKMOUSEEVENT);
+  mTrack.dwFlags = TME_LEAVE;
+  mTrack.dwHoverTime = 0;
   if (aCapture) {
+    mTrack.hwndTrack = mWnd;
     ::SetCapture(mWnd);
   } else {
+    mTrack.hwndTrack = nullptr;
     ::ReleaseCapture();
   }
   sIsInMouseCapture = aCapture;
+  // Requests WM_MOUSELEAVE events for this window.
+  TrackMouseEvent(&mTrack);
   return NS_OK;
 }
 
 /**************************************************************
  *
  * SECTION: nsIWidget::CaptureRollupEvents
  *
  * Dealing with event rollup on destroy for popups. Enables &
@@ -4852,25 +4860,16 @@ nsWindow::ProcessMessage(UINT msg, WPARA
       if (!AutoErase((HDC)wParam)) {
         *aRetValue = 1;
         result = true;
       }
       break;
 
     case WM_MOUSEMOVE:
     {
-      if (!mMousePresent) {
-        TRACKMOUSEEVENT tme;
-        tme.cbSize = sizeof(TRACKMOUSEEVENT);
-        tme.dwFlags =  TME_LEAVE;
-        tme.hwndTrack = mWnd;
-        // Request WM_MOUSELEAVE events for this window.
-        TrackMouseEvent(&tme);
-      }
-
       mMousePresent = true;
 
       // Suppress dispatch of pending events
       // when mouse moves are generated by widget
       // creation instead of user input.
       LPARAM lParamScreen = lParamToScreen(lParam);
       POINT mp;
       mp.x      = GET_X_LPARAM(lParamScreen);
@@ -4928,22 +4927,16 @@ nsWindow::ProcessMessage(UINT msg, WPARA
       // Synthesize an event position because we don't get one from
       // WM_MOUSELEAVE.
       LPARAM pos = lParamToClient(::GetMessagePos());
       DispatchMouseEvent(NS_MOUSE_EXIT, mouseState, pos, false,
                          WidgetMouseEvent::eLeftButton, MOUSE_INPUT_SOURCE());
     }
     break;
 
-    case WM_NCMOUSELEAVE:
-      // If upon mouse leave event, only WM_NCMOUSELEAVE message is sent, sending WM_MOUSELEAVE message
-      // makes the event being properly handled.
-      SendMessage(mWnd, WM_MOUSELEAVE, 0, 0);
-    break;
-
     case WM_CONTEXTMENU:
     {
       // if the context menu is brought up from the keyboard, |lParam|
       // will be -1.
       LPARAM pos;
       bool contextMenukey = false;
       if (lParam == -1)
       {