https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0f6b9664cd1e7c44ed255353304a1f9c37c67841

commit 0f6b9664cd1e7c44ed255353304a1f9c37c67841
Author:     Hervé Poussineau <[email protected]>
AuthorDate: Sat Jun 19 18:18:14 2021 +0200
Commit:     Hervé Poussineau <[email protected]>
CommitDate: Sat Jul 10 16:27:44 2021 +0200

    [WIN32K] HACK: create a DC on all display devices and display wallpaper
---
 win32ss/gdi/eng/device.c     | 11 +++++++++++
 win32ss/user/ntuser/winsta.c | 16 ++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/win32ss/gdi/eng/device.c b/win32ss/gdi/eng/device.c
index a02ef9d3a32..46b9716016f 100644
--- a/win32ss/gdi/eng/device.c
+++ b/win32ss/gdi/eng/device.c
@@ -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;
 }
 
diff --git a/win32ss/user/ntuser/winsta.c b/win32ss/user/ntuser/winsta.c
index b5854f3dc22..b6f5f5d1459 100644
--- a/win32ss/user/ntuser/winsta.c
+++ b/win32ss/user/ntuser/winsta.c
@@ -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;
 }
 

Reply via email to