[0.4.12][WIN32K:ENG] Fix fullscreen switch regressions CORE-15325 & CORE-14684 PR#1659

In PDEVOBJ_vRefreshModeList, find a proper match for the current
display mode instead of assuming a constant index.

Both tickets regressed by SVN r74404
384affe098

Many thanks to the patches author Thomas Faber.

cherry picked from commit 0.4.13-dev-456-g
00e882c2b1
This commit is contained in:
Joachim Henze 2019-06-16 13:07:55 +02:00
parent c49b6a4bd5
commit ec3cc13ab0

View 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);