Bug 1018639 - Reset the cursor on WM_SETCURSOR message when pointer is over content. r=jimm
authorDavid Parks <davidp99@gmail.com>
Tue, 17 Mar 2015 19:12:27 -0700
changeset 239653 d3a3a4a64303a1ea7b2cd28a8d585b94a708cd6f
parent 239652 82dd5f118d14f9f65fb0a930314d8107fd67cad5
child 239654 9ab4b311726d4c515389d2593668444c502c4104
push id28606
push userryanvm@gmail.com
push dateFri, 17 Apr 2015 19:45:37 +0000
treeherdermozilla-central@a55f9bdb2bf4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1018639
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1018639 - Reset the cursor on WM_SETCURSOR message when pointer is over content. r=jimm The widget now sets its cursor whenever it gets a WM_SETCURSOR call when over content. This message is sent by the OS e.g. when the cursor enters or leaves window chrome or the area outside of the window.
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -4486,16 +4486,26 @@ nsWindow::ProcessMessage(UINT msg, WPARA
       nsUXThemeData::CheckForCompositor() &&
       WinUtils::dwmDwmDefWindowProcPtr(mWnd, msg, wParam, lParam, &dwmHitResult)) {
     *aRetValue = dwmHitResult;
     return true;
   }
 
   // (Large blocks of code should be broken out into OnEvent handlers.)
   switch (msg) {
+    // Manually reset the cursor if WM_SETCURSOR is requested while over
+    // application content (as opposed to Windows borders, etc).
+    case WM_SETCURSOR:
+      if (LOWORD(lParam) == HTCLIENT)
+      {
+        SetCursor(GetCursor());
+        result = true;
+      }
+      break;
+
     // WM_QUERYENDSESSION must be handled by all windows.
     // Otherwise Windows thinks the window can just be killed at will.
     case WM_QUERYENDSESSION:
       if (sCanQuit == TRI_UNKNOWN)
       {
         // Ask if it's ok to quit, and store the answer until we
         // get WM_ENDSESSION signaling the round is complete.
         nsCOMPtr<nsIObserverService> obsServ =