[PATCH 1/2] user32/tests: Test restoring a full screen window with WS_THICKFRAME style.

Zhiyi Zhang zzhang at codeweavers.com
Mon Mar 23 02:38:49 CDT 2020


Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
---
 dlls/user32/tests/win.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 56072bebf7..948b133701 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -8432,6 +8432,26 @@ static void test_fullscreen(void)
         }
     }
 
+    /* Test restoring a full screen window with WS_THICKFRAME style to normal */
+    /* Add WS_THICKFRAME style later so that the window can cover the entire monitor */
+    hwnd = CreateWindowA("fullscreen_class", NULL, WS_POPUP | WS_VISIBLE, 0, 0, mi.rcMonitor.right,
+                         mi.rcMonitor.bottom, NULL, NULL, GetModuleHandleA(NULL), NULL);
+    ok(!!hwnd, "CreateWindow failed, error %#x.\n", GetLastError());
+    flush_events(TRUE);
+
+    /* Add WS_THICKFRAME and exit full screen */
+    SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) | WS_THICKFRAME);
+    SetWindowPos(hwnd, 0, 0, 0, 100, 100, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS);
+    flush_events(TRUE);
+
+    GetWindowRect(hwnd, &rc);
+    /* FVWM used by the TestBots are not EWMH compliant. So this bug doesn't appear on TestBots. */
+    todo_wine_if(rc.right - rc.left != 100)
+    ok(rc.right - rc.left == 100, "Expect width %d, got %d.\n", 100, rc.right - rc.left);
+    todo_wine_if(rc.bottom - rc.top != 100)
+    ok(rc.bottom - rc.top == 100, "Expect height %d, got %d.\n", 100, rc.bottom - rc.top);
+    DestroyWindow(hwnd);
+
     UnregisterClassA("fullscreen_class", GetModuleHandleA(NULL));
 }
 
-- 
2.20.1




More information about the wine-devel mailing list