mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:03:00 +00:00
fixed problems with mouse cursor handling
svn path=/trunk/; revision=12051
This commit is contained in:
parent
e3bd28c5ae
commit
0ced40be8e
8 changed files with 131 additions and 149 deletions
|
@ -1,9 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* entry.c
|
* entry.c
|
||||||
*
|
*
|
||||||
* $Revision: 1.4 $
|
* $Revision: 1.5 $
|
||||||
* $Author: chorns $
|
* $Author: weiden $
|
||||||
* $Date: 2004/11/27 00:46:24 $
|
* $Date: 2004/12/12 17:56:51 $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -258,12 +258,6 @@ DrvEnablePDEV(IN DEVMODEW *DM,
|
||||||
}
|
}
|
||||||
PDev->KMDriver = Driver;
|
PDev->KMDriver = Driver;
|
||||||
DPRINT( "PDev: %x, Driver: %x\n", PDev, PDev->KMDriver );
|
DPRINT( "PDev: %x, Driver: %x\n", PDev, PDev->KMDriver );
|
||||||
PDev->xyCursor.x = 320;
|
|
||||||
PDev->xyCursor.y = 240;
|
|
||||||
PDev->ptlExtent.x = 0;
|
|
||||||
PDev->ptlExtent.y = 0;
|
|
||||||
PDev->cExtent = 0;
|
|
||||||
PDev->flCursor = CURSOR_DOWN;
|
|
||||||
|
|
||||||
gaulCap.ulHorzRes = 640;
|
gaulCap.ulHorzRes = 640;
|
||||||
gaulCap.ulVertRes = 480;
|
gaulCap.ulVertRes = 480;
|
||||||
|
|
|
@ -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: pointer.c,v 1.3 2004/07/03 13:45:42 navaraf Exp $
|
/* $Id: pointer.c,v 1.4 2004/12/12 17:56:52 weiden Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS VGA16 display driver
|
* PROJECT: ReactOS VGA16 display driver
|
||||||
* FILE: drivers/dd/vga/display/objects/pointer.c
|
* FILE: drivers/dd/vga/display/objects/pointer.c
|
||||||
|
@ -33,8 +33,6 @@
|
||||||
|
|
||||||
/* GLOBALS *******************************************************************/
|
/* GLOBALS *******************************************************************/
|
||||||
|
|
||||||
static LONG oldx, oldy;
|
|
||||||
static PSAVED_SCREEN_BITS ImageBehindCursor = NULL;
|
|
||||||
static VOID VGADDI_HideCursor(PPDEV ppdev);
|
static VOID VGADDI_HideCursor(PPDEV ppdev);
|
||||||
static VOID VGADDI_ShowCursor(PPDEV ppdev, PRECTL prcl);
|
static VOID VGADDI_ShowCursor(PPDEV ppdev, PRECTL prcl);
|
||||||
|
|
||||||
|
@ -166,6 +164,9 @@ BOOL InitPointer(PPDEV ppdev)
|
||||||
ULONG CursorWidth = 32, CursorHeight = 32;
|
ULONG CursorWidth = 32, CursorHeight = 32;
|
||||||
ULONG PointerAttributesSize;
|
ULONG PointerAttributesSize;
|
||||||
ULONG SavedMemSize;
|
ULONG SavedMemSize;
|
||||||
|
|
||||||
|
ppdev->xyHotSpot.x = 0;
|
||||||
|
ppdev->xyHotSpot.y = 0;
|
||||||
|
|
||||||
/* Determine the size of the pointer attributes */
|
/* Determine the size of the pointer attributes */
|
||||||
PointerAttributesSize = sizeof(VIDEO_POINTER_ATTRIBUTES) +
|
PointerAttributesSize = sizeof(VIDEO_POINTER_ATTRIBUTES) +
|
||||||
|
@ -184,7 +185,7 @@ BOOL InitPointer(PPDEV ppdev)
|
||||||
|
|
||||||
/* Allocate memory for the pixels behind the cursor */
|
/* Allocate memory for the pixels behind the cursor */
|
||||||
SavedMemSize = ((((CursorWidth + 7) & ~0x7) + 16) * CursorHeight) >> 3;
|
SavedMemSize = ((((CursorWidth + 7) & ~0x7) + 16) * CursorHeight) >> 3;
|
||||||
ImageBehindCursor = VGADDI_AllocSavedScreenBits(SavedMemSize);
|
ppdev->ImageBehindCursor = VGADDI_AllocSavedScreenBits(SavedMemSize);
|
||||||
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
@ -197,20 +198,15 @@ DrvMovePointer(IN SURFOBJ* pso,
|
||||||
{
|
{
|
||||||
PPDEV ppdev = (PPDEV)pso->dhpdev;
|
PPDEV ppdev = (PPDEV)pso->dhpdev;
|
||||||
|
|
||||||
if (x < 0 && 0 == (ppdev->flCursor & CURSOR_DOWN))
|
VGADDI_HideCursor(ppdev);
|
||||||
{
|
|
||||||
/* x < 0 and y < 0 indicates we must hide the cursor */
|
|
||||||
VGADDI_HideCursor(ppdev);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ppdev->xyCursor.x = x;
|
if(x != -1)
|
||||||
ppdev->xyCursor.y = y;
|
{
|
||||||
|
ppdev->pPointerAttributes->Column = x;
|
||||||
|
ppdev->pPointerAttributes->Row = y;
|
||||||
|
|
||||||
if (0 == (ppdev->flCursor & CURSOR_DOWN))
|
VGADDI_ShowCursor(ppdev, prcl);
|
||||||
{
|
}
|
||||||
VGADDI_ShowCursor(ppdev, prcl);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -230,20 +226,14 @@ DrvSetPointerShape(SURFOBJ* pso,
|
||||||
ULONG NewWidth, NewHeight;
|
ULONG NewWidth, NewHeight;
|
||||||
PUCHAR Src, Dest;
|
PUCHAR Src, Dest;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
|
|
||||||
/* Hide the cursor */
|
|
||||||
if (ppdev->pPointerAttributes->Enable != 0
|
|
||||||
&& 0 == (ppdev->flCursor & CURSOR_DOWN))
|
|
||||||
{
|
|
||||||
VGADDI_HideCursor(ppdev);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! psoMask)
|
if (! psoMask)
|
||||||
{
|
{
|
||||||
ppdev->flCursor = CURSOR_DOWN;
|
return SPS_DECLINE;
|
||||||
return SPS_ACCEPT_EXCLUDE;
|
|
||||||
}
|
}
|
||||||
ppdev->flCursor = ppdev->flCursor & (~ CURSOR_DOWN);
|
|
||||||
|
/* Hide the cursor */
|
||||||
|
VGADDI_HideCursor(ppdev);
|
||||||
|
|
||||||
NewWidth = abs(psoMask->lDelta) << 3;
|
NewWidth = abs(psoMask->lDelta) << 3;
|
||||||
NewHeight = (psoMask->cjBits / abs(psoMask->lDelta)) / 2;
|
NewHeight = (psoMask->cjBits / abs(psoMask->lDelta)) / 2;
|
||||||
|
@ -270,9 +260,9 @@ DrvSetPointerShape(SURFOBJ* pso,
|
||||||
ppdev->pPointerAttributes = NewPointerAttributes;
|
ppdev->pPointerAttributes = NewPointerAttributes;
|
||||||
|
|
||||||
/* Reallocate the space for the saved bits. */
|
/* Reallocate the space for the saved bits. */
|
||||||
VGADDI_FreeSavedScreenBits(ImageBehindCursor);
|
VGADDI_FreeSavedScreenBits(ppdev->ImageBehindCursor);
|
||||||
SavedMemSize = ((((NewWidth + 7) & ~0x7) + 16) * NewHeight) >> 3;
|
SavedMemSize = ((((NewWidth + 7) & ~0x7) + 16) * NewHeight) >> 3;
|
||||||
ImageBehindCursor = VGADDI_AllocSavedScreenBits(SavedMemSize);
|
ppdev->ImageBehindCursor = VGADDI_AllocSavedScreenBits(SavedMemSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
Src = (PUCHAR)psoMask->pvScan0;
|
Src = (PUCHAR)psoMask->pvScan0;
|
||||||
|
@ -293,13 +283,17 @@ DrvSetPointerShape(SURFOBJ* pso,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the new cursor position */
|
/* Set the new cursor position */
|
||||||
ppdev->xyCursor.x = x;
|
|
||||||
ppdev->xyCursor.y = y;
|
|
||||||
ppdev->xyHotSpot.x = xHot;
|
ppdev->xyHotSpot.x = xHot;
|
||||||
ppdev->xyHotSpot.y = yHot;
|
ppdev->xyHotSpot.y = yHot;
|
||||||
|
|
||||||
/* Show the cursor */
|
if(x != -1)
|
||||||
VGADDI_ShowCursor(ppdev, prcl);
|
{
|
||||||
|
ppdev->pPointerAttributes->Column = x;
|
||||||
|
ppdev->pPointerAttributes->Row = y;
|
||||||
|
|
||||||
|
/* show the cursor */
|
||||||
|
VGADDI_ShowCursor(ppdev, prcl);
|
||||||
|
}
|
||||||
|
|
||||||
return SPS_ACCEPT_EXCLUDE;
|
return SPS_ACCEPT_EXCLUDE;
|
||||||
}
|
}
|
||||||
|
@ -322,18 +316,25 @@ VGADDI_ComputePointerRect(PPDEV ppdev, LONG X, LONG Y, PRECTL Rect)
|
||||||
static VOID
|
static VOID
|
||||||
VGADDI_HideCursor(PPDEV ppdev)
|
VGADDI_HideCursor(PPDEV ppdev)
|
||||||
{
|
{
|
||||||
RECTL Rect;
|
if(ppdev->pPointerAttributes->Enable)
|
||||||
|
{
|
||||||
|
LONG cx, cy;
|
||||||
|
RECTL Rect;
|
||||||
|
|
||||||
|
ppdev->pPointerAttributes->Enable = 0;
|
||||||
|
|
||||||
|
cx = ppdev->pPointerAttributes->Column - ppdev->xyHotSpot.x;
|
||||||
|
cy = ppdev->pPointerAttributes->Row - ppdev->xyHotSpot.y;
|
||||||
|
|
||||||
|
VGADDI_ComputePointerRect(ppdev, cx, cy, &Rect);
|
||||||
|
|
||||||
VGADDI_ComputePointerRect(ppdev, oldx, oldy, &Rect);
|
/* Display what was behind cursor */
|
||||||
|
VGADDI_BltFromSavedScreenBits(Rect.left,
|
||||||
/* Display what was behind cursor */
|
Rect.top,
|
||||||
VGADDI_BltFromSavedScreenBits(Rect.left,
|
ppdev->ImageBehindCursor,
|
||||||
Rect.top,
|
Rect.right - Rect.left,
|
||||||
ImageBehindCursor,
|
Rect.bottom - Rect.top);
|
||||||
Rect.right - Rect.left,
|
}
|
||||||
Rect.bottom - Rect.top);
|
|
||||||
|
|
||||||
ppdev->pPointerAttributes->Enable = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID
|
static VOID
|
||||||
|
@ -343,19 +344,21 @@ VGADDI_ShowCursor(PPDEV ppdev, PRECTL prcl)
|
||||||
PUCHAR AndMask, XorMask;
|
PUCHAR AndMask, XorMask;
|
||||||
ULONG SizeX, SizeY;
|
ULONG SizeX, SizeY;
|
||||||
RECTL Rect;
|
RECTL Rect;
|
||||||
|
|
||||||
|
if(ppdev->pPointerAttributes->Enable)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/* Mark the cursor as currently displayed. */
|
||||||
|
ppdev->pPointerAttributes->Enable = 1;
|
||||||
|
|
||||||
if (ppdev->pPointerAttributes->Enable != 0)
|
cx = ppdev->pPointerAttributes->Column - ppdev->xyHotSpot.x;
|
||||||
{
|
cy = ppdev->pPointerAttributes->Row - ppdev->xyHotSpot.y;
|
||||||
VGADDI_HideCursor(ppdev);
|
|
||||||
}
|
|
||||||
|
|
||||||
cx = ppdev->xyCursor.x - ppdev->xyHotSpot.x;
|
|
||||||
cy = ppdev->xyCursor.y - ppdev->xyHotSpot.y;
|
|
||||||
|
|
||||||
/* Capture pixels behind the cursor */
|
/* Capture pixels behind the cursor */
|
||||||
VGADDI_ComputePointerRect(ppdev, cx, cy, &Rect);
|
VGADDI_ComputePointerRect(ppdev, cx, cy, &Rect);
|
||||||
|
|
||||||
VGADDI_BltToSavedScreenBits(ImageBehindCursor,
|
VGADDI_BltToSavedScreenBits(ppdev->ImageBehindCursor,
|
||||||
Rect.left,
|
Rect.left,
|
||||||
Rect.top,
|
Rect.top,
|
||||||
Rect.right - Rect.left,
|
Rect.right - Rect.left,
|
||||||
|
@ -384,13 +387,6 @@ VGADDI_ShowCursor(PPDEV ppdev, PRECTL prcl)
|
||||||
ppdev->pPointerAttributes->WidthInBytes,
|
ppdev->pPointerAttributes->WidthInBytes,
|
||||||
VGA_XOR);
|
VGA_XOR);
|
||||||
|
|
||||||
/* Save the new cursor location. */
|
|
||||||
oldx = cx;
|
|
||||||
oldy = cy;
|
|
||||||
|
|
||||||
/* Mark the cursor as currently displayed. */
|
|
||||||
ppdev->pPointerAttributes->Enable = 1;
|
|
||||||
|
|
||||||
if (NULL != prcl)
|
if (NULL != prcl)
|
||||||
{
|
{
|
||||||
*prcl = Rect;
|
*prcl = Rect;
|
||||||
|
|
|
@ -25,8 +25,15 @@ typedef struct _XYPAIR
|
||||||
USHORT y;
|
USHORT y;
|
||||||
} XYPAIR;
|
} XYPAIR;
|
||||||
|
|
||||||
|
typedef struct _SAVED_SCREEN_BITS
|
||||||
|
{
|
||||||
|
BOOL Free;
|
||||||
|
DWORD Offset;
|
||||||
|
ULONG Size;
|
||||||
|
LIST_ENTRY ListEntry;
|
||||||
|
} SAVED_SCREEN_BITS, *PSAVED_SCREEN_BITS;
|
||||||
|
|
||||||
// Cursor states
|
// Cursor states
|
||||||
#define CURSOR_DOWN 0x00000001
|
|
||||||
#define CURSOR_COLOR 0x00000004
|
#define CURSOR_COLOR 0x00000004
|
||||||
#define CURSOR_HW 0x00000010
|
#define CURSOR_HW 0x00000010
|
||||||
#define CURSOR_HW_ACTIVE 0x00000020
|
#define CURSOR_HW_ACTIVE 0x00000020
|
||||||
|
@ -43,14 +50,11 @@ typedef struct _PDEV
|
||||||
PVOID AssociatedSurf; // associated surface
|
PVOID AssociatedSurf; // associated surface
|
||||||
|
|
||||||
// Cursor
|
// Cursor
|
||||||
XYPAIR xyCursor; // cursor position
|
|
||||||
XYPAIR xyHotSpot; // cursor hotspot
|
XYPAIR xyHotSpot; // cursor hotspot
|
||||||
POINTL ptlExtent; // cursor extent
|
|
||||||
ULONG cExtent; // effective cursor extent
|
|
||||||
ULONG flCursor; // cursor status
|
|
||||||
|
|
||||||
// Pointer
|
// Pointer
|
||||||
PVIDEO_POINTER_ATTRIBUTES pPointerAttributes; // HW Pointer Attributes
|
PVIDEO_POINTER_ATTRIBUTES pPointerAttributes; // HW Pointer Attributes
|
||||||
|
PSAVED_SCREEN_BITS ImageBehindCursor;
|
||||||
ULONG XorMaskStartOffset; // Start offset of hardware pointer
|
ULONG XorMaskStartOffset; // Start offset of hardware pointer
|
||||||
// XOR mask relative to AND mask for
|
// XOR mask relative to AND mask for
|
||||||
// passing to HW pointer
|
// passing to HW pointer
|
||||||
|
@ -92,32 +96,6 @@ typedef enum {
|
||||||
//typedef VOID (*PFN_BankControl)(PDEVSURF, ULONG, BANK_JUST);
|
//typedef VOID (*PFN_BankControl)(PDEVSURF, ULONG, BANK_JUST);
|
||||||
typedef VOID (*PFN_BankControl)(PVOID, ULONG, BANK_JUST);
|
typedef VOID (*PFN_BankControl)(PVOID, ULONG, BANK_JUST);
|
||||||
|
|
||||||
#if 0
|
|
||||||
// descriptor for a saved screen bits block
|
|
||||||
|
|
||||||
typedef struct _SAVED_SCREEN_BITS
|
|
||||||
{
|
|
||||||
BOOL bFlags;
|
|
||||||
PBYTE pjBuffer; // pointer to save buffer start
|
|
||||||
ULONG ulSize; // size of save buffer (per plane; display memory only)
|
|
||||||
ULONG ulSaveWidthInBytes; // # of bytes across save area (including
|
|
||||||
// partial edge bytes, if any)
|
|
||||||
ULONG ulDelta; // # of bytes from end of one saved scan's saved bits to
|
|
||||||
// start of next (system memory only)
|
|
||||||
PVOID pvNextSSB; // pointer to next saved screen bits block
|
|
||||||
// for system memory blocks, saved bits start immediately
|
|
||||||
// after this structure
|
|
||||||
} SAVED_SCREEN_BITS, *PSAVED_SCREEN_BITS;
|
|
||||||
#else
|
|
||||||
typedef struct _SAVED_SCREEN_BITS
|
|
||||||
{
|
|
||||||
BOOL Free;
|
|
||||||
DWORD Offset;
|
|
||||||
ULONG Size;
|
|
||||||
LIST_ENTRY ListEntry;
|
|
||||||
} SAVED_SCREEN_BITS, *PSAVED_SCREEN_BITS;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// DEVSURF -- definition of a surface as seen and used by the various VGA
|
// DEVSURF -- definition of a surface as seen and used by the various VGA
|
||||||
// drivers
|
// drivers
|
||||||
|
|
||||||
|
|
|
@ -108,22 +108,22 @@ typedef struct _DC
|
||||||
WIN_DC_INFO w;
|
WIN_DC_INFO w;
|
||||||
} DC, *PDC;
|
} DC, *PDC;
|
||||||
|
|
||||||
typedef struct _GDIPOINTER
|
typedef struct _GDIPOINTER /* should stay private to ENG */
|
||||||
{
|
{
|
||||||
|
/* private GDI pointer handling information, required for software emulation */
|
||||||
BOOL Enabled;
|
BOOL Enabled;
|
||||||
POINTL Pos;
|
POINTL Pos;
|
||||||
SIZEL Size;
|
SIZEL Size;
|
||||||
POINTL HotSpot;
|
POINTL HotSpot;
|
||||||
|
|
||||||
PGD_MOVEPOINTER MovePointer;
|
|
||||||
|
|
||||||
XLATEOBJ *XlateObject;
|
XLATEOBJ *XlateObject;
|
||||||
HSURF ColorSurface;
|
HSURF ColorSurface;
|
||||||
HSURF MaskSurface;
|
HSURF MaskSurface;
|
||||||
HSURF SaveSurface;
|
HSURF SaveSurface;
|
||||||
|
|
||||||
|
/* public pointer information */
|
||||||
|
RECTL Exclude; /* required publicly for SPS_ACCEPT_EXCLUDE */
|
||||||
|
PGD_MOVEPOINTER MovePointer;
|
||||||
ULONG Status;
|
ULONG Status;
|
||||||
|
|
||||||
BOOL SafetySwitch;
|
BOOL SafetySwitch;
|
||||||
UINT SafetyRemoveCount;
|
UINT SafetyRemoveCount;
|
||||||
} GDIPOINTER, *PGDIPOINTER;
|
} GDIPOINTER, *PGDIPOINTER;
|
||||||
|
|
|
@ -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.78 2004/12/12 01:40:36 weiden Exp $
|
/* $Id: mouse.c,v 1.79 2004/12/12 17:56:52 weiden Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* PURPOSE: Mouse
|
* PURPOSE: Mouse
|
||||||
|
@ -41,7 +41,6 @@ MouseSafetyOnDrawStart(SURFOBJ *SurfObj, LONG HazardX1,
|
||||||
LONG tmp;
|
LONG tmp;
|
||||||
GDIDEVICE *ppdev;
|
GDIDEVICE *ppdev;
|
||||||
GDIPOINTER *pgp;
|
GDIPOINTER *pgp;
|
||||||
POINTL pt;
|
|
||||||
|
|
||||||
ASSERT(SurfObj != NULL);
|
ASSERT(SurfObj != NULL);
|
||||||
|
|
||||||
|
@ -54,7 +53,8 @@ MouseSafetyOnDrawStart(SURFOBJ *SurfObj, LONG HazardX1,
|
||||||
|
|
||||||
pgp = &ppdev->Pointer;
|
pgp = &ppdev->Pointer;
|
||||||
|
|
||||||
if (SPS_ACCEPT_NOEXCLUDE == pgp->Status)
|
if (SPS_ACCEPT_NOEXCLUDE == pgp->Status ||
|
||||||
|
pgp->Exclude.right == -1)
|
||||||
{
|
{
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
@ -68,13 +68,10 @@ MouseSafetyOnDrawStart(SURFOBJ *SurfObj, LONG HazardX1,
|
||||||
tmp = HazardY2; HazardY2 = HazardY1; HazardY1 = tmp;
|
tmp = HazardY2; HazardY2 = HazardY1; HazardY1 = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
pt.x = pgp->Pos.x - pgp->HotSpot.x;
|
if (pgp->Exclude.right >= HazardX1
|
||||||
pt.y = pgp->Pos.y - pgp->HotSpot.y;
|
&& pgp->Exclude.left <= HazardX2
|
||||||
|
&& pgp->Exclude.bottom >= HazardY1
|
||||||
if (pt.x + pgp->Size.cx >= HazardX1
|
&& pgp->Exclude.top <= HazardY2)
|
||||||
&& pt.x <= HazardX2
|
|
||||||
&& pt.y + pgp->Size.cy >= HazardY1
|
|
||||||
&& pt.y <= HazardY2)
|
|
||||||
{
|
{
|
||||||
if (0 != pgp->SafetyRemoveCount++)
|
if (0 != pgp->SafetyRemoveCount++)
|
||||||
{
|
{
|
||||||
|
@ -110,7 +107,8 @@ MouseSafetyOnDrawEnd(SURFOBJ *SurfObj)
|
||||||
|
|
||||||
pgp = &ppdev->Pointer;
|
pgp = &ppdev->Pointer;
|
||||||
|
|
||||||
if(SPS_ACCEPT_NOEXCLUDE == pgp->Status)
|
if(SPS_ACCEPT_NOEXCLUDE == pgp->Status ||
|
||||||
|
pgp->Exclude.right == -1)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -122,10 +120,16 @@ MouseSafetyOnDrawEnd(SURFOBJ *SurfObj)
|
||||||
/* Someone else removed it too, let them restore it */
|
/* Someone else removed it too, let them restore it */
|
||||||
return FALSE;
|
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)
|
if (pgp->MovePointer)
|
||||||
pgp->MovePointer(SurfObj, pgp->Pos.x, pgp->Pos.y, NULL);
|
pgp->MovePointer(SurfObj, pgp->Pos.x, pgp->Pos.y, &pgp->Exclude);
|
||||||
else
|
else
|
||||||
EngMovePointer(SurfObj, pgp->Pos.x, pgp->Pos.y, NULL);
|
EngMovePointer(SurfObj, pgp->Pos.x, pgp->Pos.y, &pgp->Exclude);
|
||||||
pgp->SafetySwitch = FALSE;
|
pgp->SafetySwitch = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,11 +156,6 @@ IntHideMousePointer(GDIDEVICE *ppdev, SURFOBJ *DestSurface)
|
||||||
|
|
||||||
pgp->Enabled = FALSE;
|
pgp->Enabled = FALSE;
|
||||||
|
|
||||||
if(pgp->Pos.x == -1)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
pt.x = pgp->Pos.x - pgp->HotSpot.x;
|
pt.x = pgp->Pos.x - pgp->HotSpot.x;
|
||||||
pt.y = pgp->Pos.y - pgp->HotSpot.y;
|
pt.y = pgp->Pos.y - pgp->HotSpot.y;
|
||||||
|
|
||||||
|
@ -368,20 +367,15 @@ EngSetPointerShape(
|
||||||
pgp->HotSpot.x = xHot;
|
pgp->HotSpot.x = xHot;
|
||||||
pgp->HotSpot.y = yHot;
|
pgp->HotSpot.y = yHot;
|
||||||
|
|
||||||
pgp->Pos.x = x;
|
if (x != -1)
|
||||||
pgp->Pos.y = y;
|
{
|
||||||
|
pgp->Pos.x = x;
|
||||||
|
pgp->Pos.y = y;
|
||||||
|
}
|
||||||
|
|
||||||
pgp->Size.cx = abs(psoMask->lDelta) << 3;
|
pgp->Size.cx = abs(psoMask->lDelta) << 3;
|
||||||
pgp->Size.cy = (psoMask->cjBits / abs(psoMask->lDelta)) >> 1;
|
pgp->Size.cy = (psoMask->cjBits / abs(psoMask->lDelta)) >> 1;
|
||||||
|
|
||||||
if (prcl != NULL)
|
|
||||||
{
|
|
||||||
/* FIXME - right rectangle when x == -1? */
|
|
||||||
prcl->left = pgp->Pos.x - pgp->HotSpot.x;
|
|
||||||
prcl->top = pgp->Pos.y - pgp->HotSpot.x;
|
|
||||||
prcl->right = prcl->left + pgp->Size.cx;
|
|
||||||
prcl->bottom = prcl->top + pgp->Size.cy;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (psoColor != NULL)
|
if (psoColor != NULL)
|
||||||
{
|
{
|
||||||
PBYTE Bits;
|
PBYTE Bits;
|
||||||
|
@ -474,7 +468,17 @@ EngSetPointerShape(
|
||||||
if(x != -1)
|
if(x != -1)
|
||||||
{
|
{
|
||||||
IntShowMousePointer(ppdev, pso);
|
IntShowMousePointer(ppdev, pso);
|
||||||
|
|
||||||
|
if (prcl != NULL)
|
||||||
|
{
|
||||||
|
prcl->left = pgp->Pos.x - pgp->HotSpot.x;
|
||||||
|
prcl->top = pgp->Pos.y - pgp->HotSpot.x;
|
||||||
|
prcl->right = prcl->left + pgp->Size.cx;
|
||||||
|
prcl->bottom = prcl->top + pgp->Size.cy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME - touch prcl when x == -1? */
|
||||||
|
|
||||||
return SPS_ACCEPT_EXCLUDE;
|
return SPS_ACCEPT_EXCLUDE;
|
||||||
}
|
}
|
||||||
|
@ -501,23 +505,22 @@ EngMovePointer(
|
||||||
|
|
||||||
pgp = &ppdev->Pointer;
|
pgp = &ppdev->Pointer;
|
||||||
|
|
||||||
|
|
||||||
IntHideMousePointer(ppdev, pso);
|
IntHideMousePointer(ppdev, pso);
|
||||||
if (x != -1)
|
if (x != -1)
|
||||||
{
|
{
|
||||||
pgp->Pos.x = x;
|
pgp->Pos.x = x;
|
||||||
pgp->Pos.y = y;
|
pgp->Pos.y = y;
|
||||||
IntShowMousePointer(ppdev, pso);
|
IntShowMousePointer(ppdev, pso);
|
||||||
|
if (prcl != NULL)
|
||||||
|
{
|
||||||
|
prcl->left = pgp->Pos.x - pgp->HotSpot.x;
|
||||||
|
prcl->top = pgp->Pos.y - pgp->HotSpot.x;
|
||||||
|
prcl->right = prcl->left + pgp->Size.cx;
|
||||||
|
prcl->bottom = prcl->top + pgp->Size.cy;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prcl != NULL)
|
/* FIXME - touch prcl when x == -1? */
|
||||||
{
|
|
||||||
/* FIXME - right rectangle when x == -1? */
|
|
||||||
prcl->left = pgp->Pos.x - pgp->HotSpot.x;
|
|
||||||
prcl->top = pgp->Pos.y - pgp->HotSpot.x;
|
|
||||||
prcl->right = prcl->left + pgp->Size.cx;
|
|
||||||
prcl->bottom = prcl->top + pgp->Size.cy;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -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: cursoricon.c,v 1.1 2004/12/12 01:40:38 weiden Exp $ */
|
/* $Id: cursoricon.c,v 1.2 2004/12/12 17:56:52 weiden Exp $ */
|
||||||
#include <w32k.h>
|
#include <w32k.h>
|
||||||
|
|
||||||
PCURICON_OBJECT FASTCALL
|
PCURICON_OBJECT FASTCALL
|
||||||
|
@ -92,6 +92,9 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor,
|
||||||
/* Remove the cursor if it was displayed */
|
/* Remove the cursor if it was displayed */
|
||||||
if (GDIDEV(SurfObj)->Pointer.MovePointer)
|
if (GDIDEV(SurfObj)->Pointer.MovePointer)
|
||||||
GDIDEV(SurfObj)->Pointer.MovePointer(SurfObj, -1, -1, NULL);
|
GDIDEV(SurfObj)->Pointer.MovePointer(SurfObj, -1, -1, NULL);
|
||||||
|
else
|
||||||
|
EngMovePointer(SurfObj, -1, -1, NULL);
|
||||||
|
GDIDEV(SurfObj)->Pointer.Exclude.right = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
GDIDEV(SurfObj)->Pointer.Status = SPS_ACCEPT_NOEXCLUDE;
|
GDIDEV(SurfObj)->Pointer.Status = SPS_ACCEPT_NOEXCLUDE;
|
||||||
|
|
|
@ -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: input.c,v 1.39 2004/12/12 01:40:37 weiden Exp $
|
/* $Id: input.c,v 1.40 2004/12/12 17:56:52 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -650,8 +650,13 @@ IntMouseInput(MOUSEINPUT *mi)
|
||||||
|
|
||||||
if (GDIDEV(SurfObj)->Pointer.MovePointer)
|
if (GDIDEV(SurfObj)->Pointer.MovePointer)
|
||||||
{
|
{
|
||||||
GDIDEV(SurfObj)->Pointer.MovePointer(SurfObj, MousePos.x, MousePos.y, NULL);
|
GDIDEV(SurfObj)->Pointer.MovePointer(SurfObj, MousePos.x, MousePos.y, &(GDIDEV(SurfObj)->Pointer.Exclude));
|
||||||
}
|
}
|
||||||
|
/* FIXME - That's a bad thing! We should't access private gdi pointer fields
|
||||||
|
from here. However it is required so MouseSafetyOnDrawEnd() can
|
||||||
|
properly paint the mouse cursor to the screen again. See the
|
||||||
|
comment in MouseSafetyOnDrawEnd() to fix this problem! */
|
||||||
|
GDIDEV(SurfObj)->Pointer.Pos = MousePos;
|
||||||
|
|
||||||
BITMAPOBJ_UnlockBitmap(hBitmap);
|
BITMAPOBJ_UnlockBitmap(hBitmap);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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: dc.c,v 1.149 2004/12/12 01:40:38 weiden Exp $
|
/* $Id: dc.c,v 1.150 2004/12/12 17:56:52 weiden Exp $
|
||||||
*
|
*
|
||||||
* DC.C - Device context functions
|
* DC.C - Device context functions
|
||||||
*
|
*
|
||||||
|
@ -622,6 +622,8 @@ IntCreatePrimarySurface()
|
||||||
DPRINT("Adjusting GDIInfo.ulLogPixelsY\n");
|
DPRINT("Adjusting GDIInfo.ulLogPixelsY\n");
|
||||||
PrimarySurface.GDIInfo.ulLogPixelsY = 96;
|
PrimarySurface.GDIInfo.ulLogPixelsY = 96;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PrimarySurface.Pointer.Exclude.right = -1;
|
||||||
|
|
||||||
DPRINT("calling completePDev\n");
|
DPRINT("calling completePDev\n");
|
||||||
|
|
||||||
|
@ -659,7 +661,8 @@ IntCreatePrimarySurface()
|
||||||
SurfaceRect.left = SurfaceRect.top = 0;
|
SurfaceRect.left = SurfaceRect.top = 0;
|
||||||
SurfaceRect.right = SurfObj->sizlBitmap.cx;
|
SurfaceRect.right = SurfObj->sizlBitmap.cx;
|
||||||
SurfaceRect.bottom = SurfObj->sizlBitmap.cy;
|
SurfaceRect.bottom = SurfObj->sizlBitmap.cy;
|
||||||
EngEraseSurface(SurfObj, &SurfaceRect, 0);
|
/* FIXME - why does EngEraseSurface() sometimes crash?
|
||||||
|
EngEraseSurface(SurfObj, &SurfaceRect, 0); */
|
||||||
EngUnlockSurface(SurfObj);
|
EngUnlockSurface(SurfObj);
|
||||||
IntShowDesktop(IntGetActiveDesktop(), SurfSize.cx, SurfSize.cy);
|
IntShowDesktop(IntGetActiveDesktop(), SurfSize.cx, SurfSize.cy);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue