diff --git a/reactos/subsys/win32k/eng/copybits.c b/reactos/subsys/win32k/eng/copybits.c index 5ac9cf6d079..6ccbeffcde6 100644 --- a/reactos/subsys/win32k/eng/copybits.c +++ b/reactos/subsys/win32k/eng/copybits.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: copybits.c,v 1.21 2004/02/24 13:27:02 weiden Exp $ +/* $Id: copybits.c,v 1.22 2004/03/05 09:02:41 hbirr Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -48,7 +48,8 @@ EngCopyBits(SURFOBJ *Dest, POINTL *SourcePoint) { BOOLEAN ret; - SURFGDI *DestGDI, *SourceGDI; + PSURFGDI DestGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Dest), + SourceGDI = (PSURFGDI)AccessInternalObjectFromUserObject(Source); BYTE clippingType; RECTL rclTmp; POINTL ptlTmp; @@ -79,8 +80,8 @@ EngCopyBits(SURFOBJ *Dest, ret = DestGDI->CopyBits(Dest, Source, Clip, ColorTranslation, DestRect, SourcePoint); IntUnLockGDIDriver(DestGDI); - MouseSafetyOnDrawEnd(Source, SourceGDI); MouseSafetyOnDrawEnd(Dest, DestGDI); + MouseSafetyOnDrawEnd(Source, SourceGDI); return ret; } @@ -97,8 +98,8 @@ EngCopyBits(SURFOBJ *Dest, ret = SourceGDI->CopyBits(Dest, Source, Clip, ColorTranslation, DestRect, SourcePoint); IntUnLockGDIDriver(DestGDI); - MouseSafetyOnDrawEnd(Source, SourceGDI); MouseSafetyOnDrawEnd(Dest, DestGDI); + MouseSafetyOnDrawEnd(Source, SourceGDI); return ret; } @@ -109,8 +110,8 @@ EngCopyBits(SURFOBJ *Dest, NULL, Clip, ColorTranslation, DestRect, SourcePoint, NULL, NULL, NULL, 0); - MouseSafetyOnDrawEnd(Source, SourceGDI); MouseSafetyOnDrawEnd(Dest, DestGDI); + MouseSafetyOnDrawEnd(Source, SourceGDI); return ret; } @@ -131,8 +132,8 @@ EngCopyBits(SURFOBJ *Dest, case DC_TRIVIAL: DestGDI->DIB_BitBlt(Dest, Source, DestGDI, SourceGDI, DestRect, SourcePoint, NULL, NULL, ColorTranslation, SRCCOPY); - MouseSafetyOnDrawEnd(Source, SourceGDI); MouseSafetyOnDrawEnd(Dest, DestGDI); + MouseSafetyOnDrawEnd(Source, SourceGDI); return(TRUE); @@ -145,8 +146,8 @@ EngCopyBits(SURFOBJ *Dest, DestGDI->DIB_BitBlt(Dest, Source, DestGDI, SourceGDI, &rclTmp, &ptlTmp, NULL, NULL, ColorTranslation, SRCCOPY); - MouseSafetyOnDrawEnd(Source, SourceGDI); MouseSafetyOnDrawEnd(Dest, DestGDI); + MouseSafetyOnDrawEnd(Source, SourceGDI); return(TRUE); @@ -178,15 +179,14 @@ EngCopyBits(SURFOBJ *Dest, } while(EnumMore); - MouseSafetyOnDrawEnd(Source, SourceGDI); - MouseSafetyOnDrawEnd(Dest, DestGDI); + MouseSafetyOnDrawEnd(Source, SourceGDI); return(TRUE); } - MouseSafetyOnDrawEnd(Source, SourceGDI); MouseSafetyOnDrawEnd(Dest, DestGDI); + MouseSafetyOnDrawEnd(Source, SourceGDI); return FALSE; } diff --git a/reactos/subsys/win32k/eng/mouse.c b/reactos/subsys/win32k/eng/mouse.c index 16c09ed385d..4b8ee94375a 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.62 2004/02/24 13:27:02 weiden Exp $ +/* $Id: mouse.c,v 1.63 2004/03/05 09:02:41 hbirr Exp $ * * PROJECT: ReactOS kernel * PURPOSE: Mouse @@ -53,6 +53,10 @@ /* FUNCTIONS *****************************************************************/ +BOOL FASTCALL +IntIsPrimarSurface(PSURFGDI SurfGDI); + + BOOL FASTCALL IntCheckClipCursor(LONG *x, LONG *y, PSYSTEM_CURSORINFO CurInfo) { @@ -109,9 +113,7 @@ MouseSafetyOnDrawStart(PSURFOBJ SurfObj, PSURFGDI SurfGDI, LONG HazardX1, ObDereferenceObject(InputWindowStation); return(FALSE); } - - - if (SurfObj->iType != STYPE_DEVICE || MouseEnabled == FALSE) + if (!IntIsPrimarSurface(SurfGDI) || MouseEnabled == FALSE) { ObDereferenceObject(InputWindowStation); return(FALSE); @@ -199,8 +201,7 @@ MouseSafetyOnDrawEnd(PSURFOBJ SurfObj, PSURFGDI SurfGDI) } MouseEnabled = CurInfo->Enabled && CurInfo->ShowingCursor; - - if (SurfObj->iType != STYPE_DEVICE || MouseEnabled == FALSE) + if (!IntIsPrimarSurface(SurfGDI) || MouseEnabled == FALSE) { ExReleaseFastMutex(&CurInfo->CursorMutex); ObDereferenceObject(InputWindowStation); diff --git a/reactos/subsys/win32k/eng/transblt.c b/reactos/subsys/win32k/eng/transblt.c index 5caab776e47..36809670fd2 100644 --- a/reactos/subsys/win32k/eng/transblt.c +++ b/reactos/subsys/win32k/eng/transblt.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: transblt.c,v 1.11 2004/02/24 13:27:02 weiden Exp $ +/* $Id: transblt.c,v 1.12 2004/03/05 09:02:42 hbirr Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -102,8 +102,8 @@ EngTransparentBlt(PSURFOBJ Dest, TransparentColor, Reserved); IntUnLockGDIDriver(DestGDI); - MouseSafetyOnDrawEnd(Source, SourceGDI); MouseSafetyOnDrawEnd(Dest, DestGDI); + MouseSafetyOnDrawEnd(Source, SourceGDI); if(EngDeleteSurface(hTemp) == FALSE) { @@ -116,8 +116,8 @@ EngTransparentBlt(PSURFOBJ Dest, // Simulate a transparent blt - MouseSafetyOnDrawEnd(Source, SourceGDI); MouseSafetyOnDrawEnd(Dest, DestGDI); + MouseSafetyOnDrawEnd(Source, SourceGDI); return TRUE; } diff --git a/reactos/subsys/win32k/objects/dc.c b/reactos/subsys/win32k/objects/dc.c index b709d7d6d39..19fa36ca070 100644 --- a/reactos/subsys/win32k/objects/dc.c +++ b/reactos/subsys/win32k/objects/dc.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: dc.c,v 1.121 2004/02/19 21:12:10 weiden Exp $ +/* $Id: dc.c,v 1.122 2004/03/05 09:02:42 hbirr Exp $ * * DC.C - Device context functions * @@ -2072,4 +2072,14 @@ DC_SetOwnership(HDC hDC, PEPROCESS Owner) } } +BOOL FASTCALL +IntIsPrimarSurface(PSURFGDI SurfGDI) +{ + if (PrimarySurface.Handle == NULL) + { + return FALSE; + } + return SurfGDI == (PSURFGDI)AccessInternalObject((ULONG) PrimarySurface.Handle) ? TRUE : FALSE; +} + /* EOF */