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 */
PGD_MOVEPOINTER MovePointer;
ULONG Status;
BOOL SafetySwitch;
UINT SafetyRemoveLevel; /* at what level was the cursor removed?
0 for not removed */
UINT SafetyRemoveCount;
} GDIPOINTER, *PGDIPOINTER;

View file

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