[ros-diffs] [tkreuzer] 46976: [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

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Wed Apr 21 15:44:07 CEST 2010


Author: tkreuzer
Date: Wed Apr 21 15:44:06 2010
New Revision: 46976

URL: http://svn.reactos.org/svn/reactos?rev=46976&view=rev
Log:
[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

Modified:
    branches/reactos-yarotows/subsystems/win32/win32k/TODO.txt
    branches/reactos-yarotows/subsystems/win32/win32k/eng/mouse.c
    branches/reactos-yarotows/subsystems/win32/win32k/ntuser/display.c

Modified: branches/reactos-yarotows/subsystems/win32/win32k/TODO.txt
URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win32/win32k/TODO.txt?rev=46976&r1=46975&r2=46976&view=diff
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/TODO.txt [iso-8859-1] (original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/TODO.txt [iso-8859-1] Wed Apr 21 15:44:06 2010
@@ -11,7 +11,6 @@
 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

Modified: branches/reactos-yarotows/subsystems/win32/win32k/eng/mouse.c
URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win32/win32k/eng/mouse.c?rev=46976&r1=46975&r2=46976&view=diff
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/eng/mouse.c [iso-8859-1] (original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/eng/mouse.c [iso-8859-1] Wed Apr 21 15:44:06 2010
@@ -514,20 +514,6 @@
     }
 }
 
-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 @@
     }
     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);
 }

Modified: branches/reactos-yarotows/subsystems/win32/win32k/ntuser/display.c
URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win32/win32k/ntuser/display.c?rev=46976&r1=46975&r2=46976&view=diff
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] (original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] Wed Apr 21 15:44:06 2010
@@ -674,6 +674,7 @@
 
 BOOL APIENTRY UserClipCursor(RECTL *prcl);
 VOID APIENTRY UserRedrawDesktop();
+HCURSOR FASTCALL UserSetCursor(PCURICON_OBJECT NewCursor, BOOL ForceChange);
 
 LONG
 APIENTRY
@@ -753,7 +754,17 @@
     {
         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,10 +776,10 @@
         /* Update the system metrics */
         InitMetrics();
 
+        //IntvGetDeviceCaps(&PrimarySurface, &GdiHandleTable->DevCaps);
+
         /* Remove all cursor clipping */
         UserClipCursor(NULL);
-
-        //IntvGetDeviceCaps(&PrimarySurface, &GdiHandleTable->DevCaps);
 
         pdesk = IntGetActiveDesktop();
         //IntHideDesktop(pdesk);




More information about the Ros-diffs mailing list