[0.4.9][WIN32K:ENG] Fix fullscreen switch regressions CORE-15325 & CORE-14684 PR...
authorJoachim Henze <Joachim.Henze@reactos.org>
Thu, 8 Oct 2020 15:53:51 +0000 (17:53 +0200)
committerJoachim Henze <Joachim.Henze@reactos.org>
Thu, 8 Oct 2020 15:53:51 +0000 (17:53 +0200)
In PDEVOBJ_vRefreshModeList, find a proper match for the current
display mode instead of assuming a constant index.

Both tickets CORE-15325 & CORE-14684 regressed by SVN r74404
384affe098a91ce38623e4703f25ab139eff68de

fix cherry picked from commit 0.4.13-dev-456-g
00e882c2b1ba302d01c2c63a803d78e4fbac7168
Many thanks to the patches author Thomas Faber.

With this commit we sync PDEVOBJ_vRefreshModeList() to the state I used in 0.4.12rls and 0.4.13rls.

This patch does fix:
- regression CORE-15325 "Pocket Tanks 1.6 not filling the whole screen because it does not switch its resolution when coming from desktop res 1024x768 32bpp"
- regression CORE-14684 "Fall 0.1.3 opens just a white window instead of content when started with desktop resolution 1024x768 32bpp"
- regression "Globulation 2 0.9.4.4 not filling the whole screen when configured to use fullscreen and running it from desktop resolution 1024x768 32bpp"

but also helps to fix the last app that was still affected by CORE-14363 "systray icons do flash through now when an app is running in fullscreen".
CORE-14363 actually was fixed for >95% of the apps already by my last commit into the releases, but there was an outlier that does require Thomas patch additionally, that was:
- "Pengupop 2.2.3 when being run from desktop with 1024x768 32 bpp"

I committed it beforehand:
- for master:    0.4.13-dev-456-g00e882c
- for 0.4.12rls: 0.4.12-RC-34-gec3cc13
- for 0.4.11rls: 0.4.11-release-4-g11e0b0b
- for 0.4.10rls: 0.4.10-release-6-g58f9e1e

win32ss/gdi/eng/pdevobj.c

index 64d1832..9c10d90 100644 (file)
@@ -266,6 +266,7 @@ PDEVOBJ_vRefreshModeList(
     PGRAPHICS_DEVICE pGraphicsDevice;
     PDEVMODEINFO pdminfo, pdmiNext;
     DEVMODEW dmDefault;
+    DEVMODEW dmCurrent;
 
     /* Lock the PDEV */
     EngAcquireSemaphore(ppdev->hsemDevLock);
@@ -274,6 +275,7 @@ PDEVOBJ_vRefreshModeList(
 
     /* Remember our default mode */
     dmDefault = *pGraphicsDevice->pDevModeList[pGraphicsDevice->iDefaultMode].pdm;
+    dmCurrent = *ppdev->pdmwDev;
 
     /* 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");
     }
 
-    ppdev->pdmwDev = pGraphicsDevice->pDevModeList[pGraphicsDevice->iCurrentMode].pdm;
+    ppdev->pdmwDev = PDEVOBJ_pdmMatchDevMode(ppdev, &dmCurrent);
 
     /* Unlock PDEV */
     EngReleaseSemaphore(ppdev->hsemDevLock);