From 41562afcd3d754c79cab01ad4b7daa1b11dbf6f8 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Mon, 15 Mar 2004 20:21:51 +0000 Subject: [PATCH] - Minor corrections to emulated mouse pointer handling. svn path=/trunk/; revision=8749 --- reactos/subsys/win32k/eng/mouse.c | 15 +++-------- reactos/subsys/win32k/objects/cursoricon.c | 30 ++++++++++++++-------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/reactos/subsys/win32k/eng/mouse.c b/reactos/subsys/win32k/eng/mouse.c index 4b8ee94375a..b6de75051a3 100644 --- a/reactos/subsys/win32k/eng/mouse.c +++ b/reactos/subsys/win32k/eng/mouse.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: mouse.c,v 1.63 2004/03/05 09:02:41 hbirr Exp $ +/* $Id: mouse.c,v 1.64 2004/03/15 20:21:50 navaraf Exp $ * * PROJECT: ReactOS kernel * PURPOSE: Mouse @@ -282,7 +282,8 @@ MouseMoveCursor(LONG X, LONG Y) { ExAcquireFastMutex(&CurInfo->CursorMutex); IntLockGDIDriver(SurfGDI); - SurfGDI->MovePointer(SurfObj, CurInfo->x, CurInfo->y, &PointerRect); + if (SurfGDI->MovePointer != NULL) + SurfGDI->MovePointer(SurfObj, CurInfo->x, CurInfo->y, &PointerRect); IntUnLockGDIDriver(SurfGDI); SetPointerRect(CurInfo, &PointerRect); ExReleaseFastMutex(&CurInfo->CursorMutex); @@ -849,14 +850,6 @@ EngMovePointer( IN RECTL *prcl) { GDIDEVICE *ppdev = (GDIDEVICE *)pso->hdev; - PSURFGDI SurfGDI = AccessInternalObjectFromUserObject(pso); - - /* - * Prevent GDI from trying to remve the mouse cursor, - * because it would cause unexpected reentrancy effects. - */ - - SurfGDI->PointerStatus = SPS_ACCEPT_NOEXCLUDE; IntHideMousePointer(ppdev, pso); ppdev->PointerAttributes.Column = x - ppdev->PointerHotSpot.x; @@ -873,8 +866,6 @@ EngMovePointer( prcl->right = prcl->left + ppdev->PointerAttributes.Width; prcl->bottom = prcl->top + ppdev->PointerAttributes.Height; } - - SurfGDI->PointerStatus = SPS_ACCEPT_EXCLUDE; } /* EOF */ diff --git a/reactos/subsys/win32k/objects/cursoricon.c b/reactos/subsys/win32k/objects/cursoricon.c index 6d8e4c0ad70..fd8c54e2034 100644 --- a/reactos/subsys/win32k/objects/cursoricon.c +++ b/reactos/subsys/win32k/objects/cursoricon.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: cursoricon.c,v 1.50 2004/02/27 10:08:21 weiden Exp $ */ +/* $Id: cursoricon.c,v 1.51 2004/03/15 20:21:51 navaraf Exp $ */ #undef WIN32_LEAN_AND_MEAN @@ -146,7 +146,8 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor, { /* Remove the cursor if it was displayed */ IntLockGDIDriver(SurfGDI); - SurfGDI->MovePointer(SurfObj, -1, -1, &PointerRect); + if (SurfGDI->MovePointer != NULL) + SurfGDI->MovePointer(SurfObj, -1, -1, &PointerRect); IntUnLockGDIDriver(SurfGDI); SetPointerRect(CurInfo, &PointerRect); } @@ -219,15 +220,22 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor, CurInfo->CurrentCursorObject = NULL; } - IntLockGDIDriver(SurfGDI); - SurfGDI->PointerStatus = SurfGDI->SetPointerShape(SurfObj, soMask, soColor, XlateObj, - NewCursor->IconInfo.xHotspot, - NewCursor->IconInfo.yHotspot, - CurInfo->x, - CurInfo->y, - &PointerRect, - SPS_CHANGE); - IntUnLockGDIDriver(SurfGDI); + if (SurfGDI->SetPointerShape != NULL) + { + IntLockGDIDriver(SurfGDI); + SurfGDI->PointerStatus = SurfGDI->SetPointerShape(SurfObj, soMask, soColor, XlateObj, + NewCursor->IconInfo.xHotspot, + NewCursor->IconInfo.yHotspot, + CurInfo->x, + CurInfo->y, + &PointerRect, + SPS_CHANGE); + IntUnLockGDIDriver(SurfGDI); + } + else + { + SurfGDI->PointerStatus = SPS_DECLINE; + } if(SurfGDI->PointerStatus == SPS_DECLINE) {