[WIN32K] HACK: create a DC on all display devices and display wallpaper

This commit is contained in:
Hervé Poussineau 2021-06-19 18:18:14 +02:00
parent 49c16e661a
commit 0f6b9664cd
2 changed files with 27 additions and 0 deletions

View file

@ -439,6 +439,17 @@ EngpRegisterGraphicsDevice(
EngReleaseSemaphore(ghsemGraphicsDeviceList);
TRACE("Prepared %lu modes for %ls\n", pGraphicsDevice->cDevModes, pGraphicsDevice->pwszDescription);
/* HACK: already in graphic mode; display wallpaper on this new display */
if (ScreenDeviceContext)
{
UNICODE_STRING DriverName = RTL_CONSTANT_STRING(L"DISPLAY");
UNICODE_STRING DisplayName;
HDC hdc;
RtlInitUnicodeString(&DisplayName, pGraphicsDevice->szWinDeviceName);
hdc = IntGdiCreateDC(&DriverName, &DisplayName, NULL, NULL, FALSE);
IntPaintDesktop(hdc);
}
return pGraphicsDevice;
}

View file

@ -327,6 +327,22 @@ co_IntInitializeDesktopGraphics(VOID)
ASSERT(pdesk);
co_IntShowDesktop(pdesk, gpsi->aiSysMet[SM_CXSCREEN], gpsi->aiSysMet[SM_CYSCREEN], TRUE);
/* HACK: display wallpaper on all secondary displays */
{
PGRAPHICS_DEVICE pGraphicsDevice;
UNICODE_STRING DriverName = RTL_CONSTANT_STRING(L"DISPLAY");
UNICODE_STRING DisplayName;
HDC hdc;
ULONG iDevNum;
for (iDevNum = 1; (pGraphicsDevice = EngpFindGraphicsDevice(NULL, iDevNum, 0)) != NULL; iDevNum++)
{
RtlInitUnicodeString(&DisplayName, pGraphicsDevice->szWinDeviceName);
hdc = IntGdiCreateDC(&DriverName, &DisplayName, NULL, NULL, FALSE);
IntPaintDesktop(hdc);
}
}
return TRUE;
}