mirror of
https://github.com/reactos/reactos.git
synced 2025-05-06 18:31:26 +00:00
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:
parent
c668ac40c1
commit
5b0f6dccee
2 changed files with 27 additions and 25 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue