solv the issue with mouse poiter is hide, do not show the mousepointer when you are...
[reactos.git] / reactos / subsys / win32k / eng / mouse.c
index e7b1a2d..3bc769c 100644 (file)
@@ -72,14 +72,14 @@ MouseSafetyOnDrawStart(SURFOBJ *SurfObj, LONG HazardX1,
       tmp = HazardY2; HazardY2 = HazardY1; HazardY1 = tmp;
     }
 
-  ppdev->SafetyRemoveCount++;
-
-  if (ppdev->SafetyRemoveLevel)
+  if (ppdev->SafetyRemoveLevel != 0)
     {
-      /* already hidden */
+      ppdev->SafetyRemoveCount++;
       return FALSE;
     }
 
+ ppdev->SafetyRemoveCount++;
+
   if (pgp->Exclude.right >= HazardX1
       && pgp->Exclude.left <= HazardX2
       && pgp->Exclude.bottom >= HazardY1
@@ -153,10 +153,13 @@ IntHideMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface)
       return;
    }
 
+      
+
    pgp->Enabled = FALSE;
 
    pt.x = pgp->Pos.x - pgp->HotSpot.x;
    pt.y = pgp->Pos.y - pgp->HotSpot.y;
+   
 
    if (pgp->SaveSurface != NULL)
    {
@@ -207,6 +210,12 @@ IntShowMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface)
    {
       return;
    }
+   
+   if (pgp->ShowPointer == 1)
+   {
+      return ;
+   }
+
 
    pgp->Enabled = TRUE;
 
@@ -389,6 +398,11 @@ EngSetPointerShape(
       PBYTE Bits;
 
       Bits = EngAllocMem(0, psoColor->cjBits, TAG_MOUSE);
+      if (Bits == NULL)
+      {
+          return SPS_ERROR;
+      }
+      
       memcpy(Bits, psoColor->pvBits, psoColor->cjBits);
 
       pgp->ColorSurface = (HSURF)EngCreateBitmap(pgp->Size,
@@ -407,6 +421,11 @@ EngSetPointerShape(
       Size.cx = pgp->Size.cx;
       Size.cy = pgp->Size.cy << 1;
       Bits = EngAllocMem(0, psoMask->cjBits, TAG_MOUSE);
+      if (Bits == NULL)
+      {
+          return SPS_ERROR;
+      }
+      
       memcpy(Bits, psoMask->pvBits, psoMask->cjBits);
 
       pgp->MaskSurface = (HSURF)EngCreateBitmap(Size,