- Fixed software mouse pointer handling to work correctly with MouseSafety* routines

svn path=/trunk/; revision=8061
This commit is contained in:
Filip Navara 2004-02-06 21:12:55 +00:00
parent 5ec14bf2bf
commit 48219202b5

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: mouse.c,v 1.58 2004/01/25 16:47:09 navaraf Exp $ /* $Id: mouse.c,v 1.59 2004/02/06 21:12:55 navaraf Exp $
* *
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* PURPOSE: Mouse * PURPOSE: Mouse
@ -549,6 +549,12 @@ IntHideMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface)
} }
ppdev->PointerAttributes.Enable = FALSE; ppdev->PointerAttributes.Enable = FALSE;
if (ppdev->PointerAttributes.Column + ppdev->PointerHotSpot.x == -1)
{
return;
}
if (ppdev->PointerSaveSurface != NULL) if (ppdev->PointerSaveSurface != NULL)
{ {
RECTL DestRect; RECTL DestRect;
@ -721,7 +727,7 @@ EngSetPointerShape(
if (psoMask == NULL) if (psoMask == NULL)
{ {
return SPS_ACCEPT_EXCLUDE; return SPS_ACCEPT_NOEXCLUDE;
} }
ppdev->PointerHotSpot.x = xHot; ppdev->PointerHotSpot.x = xHot;
@ -732,6 +738,14 @@ EngSetPointerShape(
ppdev->PointerAttributes.Width = psoMask->lDelta << 3; ppdev->PointerAttributes.Width = psoMask->lDelta << 3;
ppdev->PointerAttributes.Height = (psoMask->cjBits / psoMask->lDelta) >> 1; ppdev->PointerAttributes.Height = (psoMask->cjBits / psoMask->lDelta) >> 1;
if (prcl != NULL)
{
prcl->left = ppdev->PointerAttributes.Column;
prcl->top = ppdev->PointerAttributes.Row;
prcl->right = prcl->left + ppdev->PointerAttributes.Width;
prcl->bottom = prcl->top + ppdev->PointerAttributes.Height;
}
if (psoColor != NULL) if (psoColor != NULL)
{ {
SIZEL Size; SIZEL Size;
@ -768,10 +782,7 @@ EngSetPointerShape(
* FIXME: We should get this in pxlo parameter! * FIXME: We should get this in pxlo parameter!
*/ */
/* if (pxlo == NULL)
ppdev->PointerXlateObject = pxlo;
*/
{ {
HPALETTE BWPalette, DestPalette; HPALETTE BWPalette, DestPalette;
ULONG BWColors[] = {0, 0xFFFFFF}; ULONG BWColors[] = {0, 0xFFFFFF};
@ -791,6 +802,10 @@ EngSetPointerShape(
DestPalette, BWPalette); DestPalette, BWPalette);
EngDeletePalette(BWPalette); EngDeletePalette(BWPalette);
} }
else
{
ppdev->PointerXlateObject = pxlo;
}
/* /*
* Create surface for saving the pixels under the cursor. * Create surface for saving the pixels under the cursor.
@ -834,26 +849,32 @@ EngMovePointer(
IN RECTL *prcl) IN RECTL *prcl)
{ {
GDIDEVICE *ppdev = (GDIDEVICE *)pso->hdev; GDIDEVICE *ppdev = (GDIDEVICE *)pso->hdev;
BOOL WasVisible; PSURFGDI SurfGDI = AccessInternalObjectFromUserObject(pso);
WasVisible = ppdev->PointerAttributes.Enable; /*
if (WasVisible) * Prevent GDI from trying to remve the mouse cursor,
{ * because it would cause unexpected reentrancy effects.
IntHideMousePointer(ppdev, pso); */
}
if (x == -1) SurfGDI->PointerStatus = SPS_ACCEPT_NOEXCLUDE;
{
return;
}
IntHideMousePointer(ppdev, pso);
ppdev->PointerAttributes.Column = x - ppdev->PointerHotSpot.x; ppdev->PointerAttributes.Column = x - ppdev->PointerHotSpot.x;
ppdev->PointerAttributes.Row = y - ppdev->PointerHotSpot.y; ppdev->PointerAttributes.Row = y - ppdev->PointerHotSpot.y;
if (x != -1)
if (WasVisible)
{ {
IntShowMousePointer(ppdev, pso); IntShowMousePointer(ppdev, pso);
} }
if (prcl != NULL)
{
prcl->left = ppdev->PointerAttributes.Column;
prcl->top = ppdev->PointerAttributes.Row;
prcl->right = prcl->left + ppdev->PointerAttributes.Width;
prcl->bottom = prcl->top + ppdev->PointerAttributes.Height;
}
SurfGDI->PointerStatus = SPS_ACCEPT_EXCLUDE;
} }
/* EOF */ /* EOF */