[WIN32K:ENG] In PDEVOBJ_vRefreshModeList, find a proper match for the current display... 1659/head
authorThomas Faber <thomas.faber@reactos.org>
Sat, 15 Jun 2019 19:25:01 +0000 (21:25 +0200)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 16 Jun 2019 10:45:58 +0000 (12:45 +0200)
win32ss/gdi/eng/pdevobj.c

index 85098a5..19c2fee 100644 (file)
@@ -266,6 +266,7 @@ PDEVOBJ_vRefreshModeList(
     PGRAPHICS_DEVICE pGraphicsDevice;
     PDEVMODEINFO pdminfo, pdmiNext;
     DEVMODEW dmDefault;
     PGRAPHICS_DEVICE pGraphicsDevice;
     PDEVMODEINFO pdminfo, pdmiNext;
     DEVMODEW dmDefault;
+    DEVMODEW dmCurrent;
 
     /* Lock the PDEV */
     EngAcquireSemaphore(ppdev->hsemDevLock);
 
     /* Lock the PDEV */
     EngAcquireSemaphore(ppdev->hsemDevLock);
@@ -274,6 +275,7 @@ PDEVOBJ_vRefreshModeList(
 
     /* Remember our default mode */
     dmDefault = *pGraphicsDevice->pDevModeList[pGraphicsDevice->iDefaultMode].pdm;
 
     /* Remember our default mode */
     dmDefault = *pGraphicsDevice->pDevModeList[pGraphicsDevice->iDefaultMode].pdm;
+    dmCurrent = *ppdev->pdmwDev;
 
     /* Clear out the modes */
     for (pdminfo = pGraphicsDevice->pdevmodeInfo;
 
     /* Clear out the modes */
     for (pdminfo = pGraphicsDevice->pdevmodeInfo;
@@ -293,7 +295,7 @@ PDEVOBJ_vRefreshModeList(
         DPRINT1("FIXME: EngpPopulateDeviceModeList failed, we just destroyed a perfectly good mode list\n");
     }
 
         DPRINT1("FIXME: EngpPopulateDeviceModeList failed, we just destroyed a perfectly good mode list\n");
     }
 
-    ppdev->pdmwDev = pGraphicsDevice->pDevModeList[pGraphicsDevice->iCurrentMode].pdm;
+    ppdev->pdmwDev = PDEVOBJ_pdmMatchDevMode(ppdev, &dmCurrent);
 
     /* Unlock PDEV */
     EngReleaseSemaphore(ppdev->hsemDevLock);
 
     /* Unlock PDEV */
     EngReleaseSemaphore(ppdev->hsemDevLock);