[WIN32SS:ENG] Call display mouse functions only when using hardware pointer
authorHervé Poussineau <hpoussin@reactos.org>
Tue, 11 Oct 2022 16:56:04 +0000 (18:56 +0200)
committerHervé Poussineau <hpoussin@reactos.org>
Tue, 11 Oct 2022 17:04:59 +0000 (19:04 +0200)
Otherwise, use software pointer functions.

This fixes graphical glitches on cursor change, when the display driver
provides accelerated pointer functions (DrvSetPointerShape/DrvMovePointer),
but refuses to handle a certain cursor.

These graphical glitches may be reproduced:
- by using Voodoo driver SFFT 1.9
- by using framebuf_new.dll instead of framebuf.dll
- by using the panning driver (setting DefaultSettings.XPanning and
  DefaultSettings.YPanning in registry)

win32ss/gdi/eng/mouse.c

index c8de250..9cbadcd 100644 (file)
@@ -84,7 +84,10 @@ MouseSafetyOnDrawStart(
         && pgp->Exclude.top <= HazardY2)
     {
         ppdev->SafetyRemoveLevel = ppdev->SafetyRemoveCount;
-        ppdev->pfnMovePointer(&ppdev->pSurface->SurfObj, -1, -1, NULL);
+        if (ppdev->flFlags & PDEV_HARDWARE_POINTER)
+            ppdev->pfnMovePointer(&ppdev->pSurface->SurfObj, -1, -1, NULL);
+        else if (ppdev->flFlags & PDEV_SOFTWARE_POINTER)
+            EngMovePointer(&ppdev->pSurface->SurfObj, -1, -1, NULL);
     }
 
     return TRUE;
@@ -116,10 +119,16 @@ MouseSafetyOnDrawEnd(
         return FALSE;
     }
 
-    ppdev->pfnMovePointer(&ppdev->pSurface->SurfObj,
-                          gpsi->ptCursor.x,
-                          gpsi->ptCursor.y,
-                          &pgp->Exclude);
+    if (ppdev->flFlags & PDEV_HARDWARE_POINTER)
+        ppdev->pfnMovePointer(&ppdev->pSurface->SurfObj,
+                              gpsi->ptCursor.x,
+                              gpsi->ptCursor.y,
+                              &pgp->Exclude);
+    else if (ppdev->flFlags & PDEV_SOFTWARE_POINTER)
+        EngMovePointer(&ppdev->pSurface->SurfObj,
+                       gpsi->ptCursor.x,
+                       gpsi->ptCursor.y,
+                       &pgp->Exclude);
 
     ppdev->SafetyRemoveLevel = 0;