tinus <o112w8r02@sneakemail.com>

This patch fixes some weirdness in the clipping logic. It also seems to make
these 'black cursor' images happen less often, but I can't tell for sure.

svn path=/trunk/; revision=13133
This commit is contained in:
Gé van Geldorp 2005-01-19 14:25:10 +00:00
parent c668ac40c1
commit 5b0f6dccee
2 changed files with 27 additions and 25 deletions

View file

@ -124,7 +124,8 @@ typedef struct _GDIPOINTER /* should stay private to ENG */
RECTL Exclude; /* required publicly for SPS_ACCEPT_EXCLUDE */ RECTL Exclude; /* required publicly for SPS_ACCEPT_EXCLUDE */
PGD_MOVEPOINTER MovePointer; PGD_MOVEPOINTER MovePointer;
ULONG Status; ULONG Status;
BOOL SafetySwitch; UINT SafetyRemoveLevel; /* at what level was the cursor removed?
0 for not removed */
UINT SafetyRemoveCount; UINT SafetyRemoveCount;
} GDIPOINTER, *PGDIPOINTER; } GDIPOINTER, *PGDIPOINTER;

View file

@ -68,16 +68,20 @@ MouseSafetyOnDrawStart(SURFOBJ *SurfObj, LONG HazardX1,
tmp = HazardY2; HazardY2 = HazardY1; HazardY1 = tmp; tmp = HazardY2; HazardY2 = HazardY1; HazardY1 = tmp;
} }
pgp->SafetyRemoveCount++;
if (pgp->SafetyRemoveLevel)
{
/* already hidden */
return FALSE;
}
if (pgp->Exclude.right >= HazardX1 if (pgp->Exclude.right >= HazardX1
&& pgp->Exclude.left <= HazardX2 && pgp->Exclude.left <= HazardX2
&& pgp->Exclude.bottom >= HazardY1 && pgp->Exclude.bottom >= HazardY1
&& pgp->Exclude.top <= HazardY2) && pgp->Exclude.top <= HazardY2)
{ {
if (0 != pgp->SafetyRemoveCount++) pgp->SafetyRemoveLevel = pgp->SafetyRemoveCount;
{
return FALSE;
}
pgp->SafetySwitch = TRUE;
if (pgp->MovePointer) if (pgp->MovePointer)
pgp->MovePointer(SurfObj, -1, -1, NULL); pgp->MovePointer(SurfObj, -1, -1, NULL);
else else
@ -113,25 +117,22 @@ MouseSafetyOnDrawEnd(SURFOBJ *SurfObj)
return FALSE; return FALSE;
} }
if (pgp->SafetySwitch) if (--pgp->SafetyRemoveCount >= pgp->SafetyRemoveLevel)
{ {
if (1 < pgp->SafetyRemoveCount--) return FALSE;
{ }
/* Someone else removed it too, let them restore it */ /* FIXME - this is wrong!!!!!! we must NOT access pgp->Pos from here, it's
return FALSE; a private field for ENG/driver. This will paint the cursor to the
} wrong screen coordinates when a driver overrides DrvMovePointer()!
/* FIXME - this is wrong!!!!!! we must NOT access pgp->Pos from here, it's We should store the coordinates before calling Drv/EngMovePointer()
a private field for ENG/driver. This will paint the cursor to the and Drv/EngSetPointerShape() separately in the GDIDEVICE structure
wrong screen coordinates when a driver overrides DrvMovePointer()! or somewhere where ntuser can access it! */
We should store the coordinates before calling Drv/EngMovePointer() if (pgp->MovePointer)
and Drv/EngSetPointerShape() separately in the GDIDEVICE structure pgp->MovePointer(SurfObj, pgp->Pos.x, pgp->Pos.y, &pgp->Exclude);
or somewhere where ntuser can access it! */ else
if (pgp->MovePointer) EngMovePointer(SurfObj, pgp->Pos.x, pgp->Pos.y, &pgp->Exclude);
pgp->MovePointer(SurfObj, pgp->Pos.x, pgp->Pos.y, &pgp->Exclude);
else pgp->SafetyRemoveLevel = 0;
EngMovePointer(SurfObj, pgp->Pos.x, pgp->Pos.y, &pgp->Exclude);
pgp->SafetySwitch = FALSE;
}
return(TRUE); return(TRUE);
} }