From 2250e691f1d883e471707b8ecdf76c89aaf7ba26 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 21 Apr 2010 13:44:06 +0000 Subject: [PATCH] [WIN32K] - move IntEngMovePointer code into GreMovePointer - Delete the mouse cursor before mode switch, to force setting a new one after a mode switch. Fixes cursor artifacts after mode change. - Update TODO.txt svn path=/branches/reactos-yarotows/; revision=46976 --- subsystems/win32/win32k/TODO.txt | 1 - subsystems/win32/win32k/eng/mouse.c | 30 ++++++++++-------------- subsystems/win32/win32k/ntuser/display.c | 17 +++++++++++--- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/subsystems/win32/win32k/TODO.txt b/subsystems/win32/win32k/TODO.txt index cc753f5daa8..720d9c74fdc 100644 --- a/subsystems/win32/win32k/TODO.txt +++ b/subsystems/win32/win32k/TODO.txt @@ -11,7 +11,6 @@ requirements before it can be handled. Before the merge: ----------------- # Fix mouse pointer regression -# Hide the mouse pointer during mode switch # Resize the desktop window after mode switch # Update mouse area after mode switch # Invalidate the whole Window content after mode switch diff --git a/subsystems/win32/win32k/eng/mouse.c b/subsystems/win32/win32k/eng/mouse.c index c3ceb2b446a..2b8d889dcb1 100644 --- a/subsystems/win32/win32k/eng/mouse.c +++ b/subsystems/win32/win32k/eng/mouse.c @@ -514,20 +514,6 @@ EngMovePointer( } } -VOID APIENTRY -IntEngMovePointer( - IN SURFOBJ *pso, - IN LONG x, - IN LONG y, - IN RECTL *prcl) -{ - PPDEVOBJ ppdev = (PPDEVOBJ)pso->hdev; - if(ppdev->SafetyRemoveLevel) - return ; - - ppdev->pfnMovePointer(pso, x, y, prcl); -} - ULONG APIENTRY IntEngSetPointerShape( IN SURFOBJ *pso, @@ -694,14 +680,22 @@ GreMovePointer( } ASSERT(pdc->dctype == DCTYPE_DIRECT); + /* Acquire PDEV lock */ EngAcquireSemaphore(pdc->ppdev->hsemDevLock); - /* Store the cursor exclude position in the PDEV */ - prcl = &pdc->ppdev->Pointer.Exclude; - /* Call Eng/Drv function */ - IntEngMovePointer(&pdc->ppdev->pSurface->SurfObj, x, y, prcl); + /* Check if we need to move it */ + if(pdc->ppdev->SafetyRemoveLevel == 0) + { + /* Store the cursor exclude position in the PDEV */ + prcl = &pdc->ppdev->Pointer.Exclude; + /* Call Eng/Drv function */ + pdc->ppdev->pfnMovePointer(&pdc->ppdev->pSurface->SurfObj, x, y, prcl); + } + + /* Release PDEV lock */ EngReleaseSemaphore(pdc->ppdev->hsemDevLock); + /* Unlock the DC */ DC_UnlockDc(pdc); } diff --git a/subsystems/win32/win32k/ntuser/display.c b/subsystems/win32/win32k/ntuser/display.c index 2aaa143c80a..4c7e7b1ae0a 100644 --- a/subsystems/win32/win32k/ntuser/display.c +++ b/subsystems/win32/win32k/ntuser/display.c @@ -674,6 +674,7 @@ NtUserEnumDisplaySettings( BOOL APIENTRY UserClipCursor(RECTL *prcl); VOID APIENTRY UserRedrawDesktop(); +HCURSOR FASTCALL UserSetCursor(PCURICON_OBJECT NewCursor, BOOL ForceChange); LONG APIENTRY @@ -753,7 +754,17 @@ UserChangeDisplaySettings( { ULONG ulResult; - if (!PDEVOBJ_bSwitchMode(ppdev, pdm)) + /* Remove mouse pointer */ + UserSetCursor(NULL, TRUE); + + /* Do the mode switch */ + ulResult = PDEVOBJ_bSwitchMode(ppdev, pdm); + + /* Restore mouse pointer */ + UserSetCursorPos(gpsi->ptCursor.x, gpsi->ptCursor.y); + + /* Check for failure */ + if (!ulResult) { DPRINT1("failed to set mode\n"); lResult = (lResult == DISP_CHANGE_NOTUPDATED) ? @@ -765,11 +776,11 @@ UserChangeDisplaySettings( /* Update the system metrics */ InitMetrics(); + //IntvGetDeviceCaps(&PrimarySurface, &GdiHandleTable->DevCaps); + /* Remove all cursor clipping */ UserClipCursor(NULL); - //IntvGetDeviceCaps(&PrimarySurface, &GdiHandleTable->DevCaps); - pdesk = IntGetActiveDesktop(); //IntHideDesktop(pdesk);