[PATCH resend 2/2] user32/tests: Add interactive test for restoring a fullscreen window.

Gabriel Ivăncescu gabrielopcode at gmail.com
Tue Feb 9 08:31:05 CST 2021


This does a similar sequence as a d3d9 app that relies on this.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---
 dlls/user32/tests/win.c | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index eecccb7..b951388 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -8411,6 +8411,44 @@ static void test_fullscreen(void)
     DestroyWindow(hwnd);
 
     UnregisterClassA("fullscreen_class", GetModuleHandleA(NULL));
+
+    /* Test restoring a minimized full screen window interactively */
+    if (winetest_interactive)
+    {
+        DWORD fullscreen_style = WS_POPUP | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE;
+        DWORD normal_style = WS_OVERLAPPEDWINDOW | WS_VISIBLE;
+        MSG msg;
+
+        hwnd = CreateWindowA("static", "test", normal_style, 0, 0, 32, 32, NULL, NULL,
+                             GetModuleHandleA(NULL), NULL);
+        ok(!!hwnd, "CreateWindow failed, error %#x.\n", GetLastError());
+        flush_events(TRUE);
+
+        SetWindowLongA(hwnd, GWL_STYLE, fullscreen_style);
+        SetWindowPos(hwnd, NULL, 0, 0, mi.rcMonitor.right, mi.rcMonitor.bottom,
+                     SWP_NOACTIVATE | SWP_NOZORDER);
+        flush_events(TRUE);
+
+        ShowWindow(hwnd, SW_MINIMIZE);
+        SetWindowLongA(hwnd, GWL_STYLE, normal_style);
+        flush_events(TRUE);
+
+        SetWindowLongA(hwnd, GWL_STYLE, fullscreen_style);
+        flush_events(TRUE);
+
+        trace("Please restore the minimized test window by clicking on it.\n");
+        while (IsIconic(hwnd) && GetMessageA(&msg, NULL, 0, 0) > 0)
+        {
+            TranslateMessage(&msg);
+            DispatchMessageA(&msg);
+        }
+        flush_events(TRUE);
+
+        GetWindowRect(hwnd, &rc);
+        ok(rc.right - rc.left == mi.rcMonitor.right, "Expect width %d, got %d.\n", mi.rcMonitor.right, rc.right - rc.left);
+        ok(rc.bottom - rc.top == mi.rcMonitor.bottom, "Expect height %d, got %d.\n", mi.rcMonitor.bottom, rc.bottom - rc.top);
+        DestroyWindow(hwnd);
+    }
 }
 
 static BOOL test_thick_child_got_minmax;
-- 
2.30.0




More information about the wine-devel mailing list