[WIN32SS:NTUSER] Completely update the metrics in co_IntInitializeDesktopGraphics().

This change is similar to what is done in UserChangeDisplaySettings()
after changing screen video mode.

This allows e.g. having windows to be correctly maximized during
2nd-stage GUI setup. To compare and reproduce during 2nd-stage GUI
setup, open cmd.exe (Shift-F10) and from there a GUI app, e.g.
regedit.exe, and maximize it. Observe the limits used by the window.
This commit is contained in:
Hermès Bélusca-Maïto 2019-01-05 16:36:30 +01:00
parent 01e5cb0c04
commit ca24df9c85
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -271,7 +271,7 @@ co_IntInitializeDesktopGraphics(VOID)
} }
GreSetDCOwner(ScreenDeviceContext, GDI_OBJ_HMGR_PUBLIC); GreSetDCOwner(ScreenDeviceContext, GDI_OBJ_HMGR_PUBLIC);
if (! IntCreatePrimarySurface()) if (!IntCreatePrimarySurface())
{ {
return FALSE; return FALSE;
} }
@ -281,6 +281,12 @@ co_IntInitializeDesktopGraphics(VOID)
NtGdiSelectFont(hSystemBM, NtGdiGetStockObject(SYSTEM_FONT)); NtGdiSelectFont(hSystemBM, NtGdiGetStockObject(SYSTEM_FONT));
GreSetDCOwner(hSystemBM, GDI_OBJ_HMGR_PUBLIC); GreSetDCOwner(hSystemBM, GDI_OBJ_HMGR_PUBLIC);
/* Update the system metrics */
InitMetrics();
/* Set new size of the monitor */
UserUpdateMonitorSize((HDEV)gppdevPrimary);
/* Update the SERVERINFO */ /* Update the SERVERINFO */
gpsi->aiSysMet[SM_CXSCREEN] = gppdevPrimary->gdiinfo.ulHorzRes; gpsi->aiSysMet[SM_CXSCREEN] = gppdevPrimary->gdiinfo.ulHorzRes;
gpsi->aiSysMet[SM_CYSCREEN] = gppdevPrimary->gdiinfo.ulVertRes; gpsi->aiSysMet[SM_CYSCREEN] = gppdevPrimary->gdiinfo.ulVertRes;
@ -293,7 +299,9 @@ co_IntInitializeDesktopGraphics(VOID)
gpsi->PUSIFlags |= PUSIF_PALETTEDISPLAY; gpsi->PUSIFlags |= PUSIF_PALETTEDISPLAY;
} }
else else
{
gpsi->PUSIFlags &= ~PUSIF_PALETTEDISPLAY; gpsi->PUSIFlags &= ~PUSIF_PALETTEDISPLAY;
}
// Font is realized and this dc was previously set to internal DC_ATTR. // Font is realized and this dc was previously set to internal DC_ATTR.
gpsi->cxSysFontChar = IntGetCharDimensions(hSystemBM, &tmw, (DWORD*)&gpsi->cySysFontChar); gpsi->cxSysFontChar = IntGetCharDimensions(hSystemBM, &tmw, (DWORD*)&gpsi->cySysFontChar);
gpsi->tmSysFont = tmw; gpsi->tmSysFont = tmw;