mirror of
https://github.com/reactos/reactos.git
synced 2024-12-31 19:42:51 +00:00
[WIN32SS] mouse: use pointer flags in PDEVOBJ
When changing pointer cursor: - use PDEV_HARDWARE_POINTER flag if using hardware pointer - use PDEV_SOFTWARE_POINTER flag if using software pointer - keep pfnMovePointer as an accelerator to driver function (if available) and never change it - fix bug (2 pointers) when switching between hardware and software pointer When moving pointer: - check PDEV_HARDWARE_POINTER flag to know if we need to call the driver - check PDEV_SOFTWARE_POINTER flag to know if we need to call EngMovePointer
This commit is contained in:
parent
37c2bb3985
commit
57c07ba117
1 changed files with 39 additions and 11 deletions
|
@ -618,6 +618,8 @@ IntEngSetPointerShape(
|
||||||
ULONG ulResult = SPS_DECLINE;
|
ULONG ulResult = SPS_DECLINE;
|
||||||
PFN_DrvSetPointerShape pfnSetPointerShape;
|
PFN_DrvSetPointerShape pfnSetPointerShape;
|
||||||
PPDEVOBJ ppdev = GDIDEV(pso);
|
PPDEVOBJ ppdev = GDIDEV(pso);
|
||||||
|
BOOL bHardwarePointer = FALSE;
|
||||||
|
BOOL bSoftwarePointer = TRUE;
|
||||||
|
|
||||||
pfnSetPointerShape = GDIDEVFUNCS(pso).SetPointerShape;
|
pfnSetPointerShape = GDIDEVFUNCS(pso).SetPointerShape;
|
||||||
|
|
||||||
|
@ -638,15 +640,15 @@ IntEngSetPointerShape(
|
||||||
y,
|
y,
|
||||||
prcl,
|
prcl,
|
||||||
fl);
|
fl);
|
||||||
|
|
||||||
|
/* Check if the driver accepted it */
|
||||||
|
if (ulResult == SPS_ACCEPT_NOEXCLUDE)
|
||||||
|
bHardwarePointer = TRUE;
|
||||||
|
|
||||||
|
bSoftwarePointer = !bHardwarePointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the driver accepted it */
|
if (bSoftwarePointer)
|
||||||
if (ulResult == SPS_ACCEPT_NOEXCLUDE)
|
|
||||||
{
|
|
||||||
/* Set MovePointer to the driver function */
|
|
||||||
ppdev->pfnMovePointer = GDIDEVFUNCS(pso).MovePointer;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
/* Set software pointer */
|
/* Set software pointer */
|
||||||
ulResult = EngSetPointerShape(pso,
|
ulResult = EngSetPointerShape(pso,
|
||||||
|
@ -659,10 +661,31 @@ IntEngSetPointerShape(
|
||||||
y,
|
y,
|
||||||
prcl,
|
prcl,
|
||||||
fl);
|
fl);
|
||||||
/* Set MovePointer to the eng function */
|
|
||||||
ppdev->pfnMovePointer = EngMovePointer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!bSoftwarePointer && ppdev->flFlags & PDEV_SOFTWARE_POINTER)
|
||||||
|
{
|
||||||
|
/* Disable software pointer */
|
||||||
|
EngMovePointer(pso, -1, -1, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bHardwarePointer && ppdev->flFlags & PDEV_HARDWARE_POINTER)
|
||||||
|
{
|
||||||
|
/* Disable hardware pointer */
|
||||||
|
ppdev->pfnMovePointer(pso, -1, -1, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Update flags */
|
||||||
|
if (bSoftwarePointer)
|
||||||
|
ppdev->flFlags |= PDEV_SOFTWARE_POINTER;
|
||||||
|
else
|
||||||
|
ppdev->flFlags &= ~PDEV_SOFTWARE_POINTER;
|
||||||
|
|
||||||
|
if (bHardwarePointer)
|
||||||
|
ppdev->flFlags |= PDEV_HARDWARE_POINTER;
|
||||||
|
else
|
||||||
|
ppdev->flFlags &= ~PDEV_HARDWARE_POINTER;
|
||||||
|
|
||||||
return ulResult;
|
return ulResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -787,11 +810,16 @@ GreMovePointer(
|
||||||
/* Check if we need to move it */
|
/* Check if we need to move it */
|
||||||
if(pdc->ppdev->SafetyRemoveLevel == 0)
|
if(pdc->ppdev->SafetyRemoveLevel == 0)
|
||||||
{
|
{
|
||||||
|
SURFOBJ* pso = &pdc->ppdev->pSurface->SurfObj;
|
||||||
|
|
||||||
/* Store the cursor exclude position in the PDEV */
|
/* Store the cursor exclude position in the PDEV */
|
||||||
prcl = &pdc->ppdev->Pointer.Exclude;
|
prcl = &pdc->ppdev->Pointer.Exclude;
|
||||||
|
|
||||||
/* Call Eng/Drv function */
|
/* Send new position of the hot spot of the pointer (will likely redraw cursor) */
|
||||||
pdc->ppdev->pfnMovePointer(&pdc->ppdev->pSurface->SurfObj, x, y, prcl);
|
if (pdc->ppdev->flFlags & PDEV_HARDWARE_POINTER)
|
||||||
|
pdc->ppdev->pfnMovePointer(pso, x, y, prcl);
|
||||||
|
else if (pdc->ppdev->flFlags & PDEV_SOFTWARE_POINTER)
|
||||||
|
EngMovePointer(pso, x, y, prcl);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release PDEV lock */
|
/* Release PDEV lock */
|
||||||
|
|
Loading…
Reference in a new issue