Module: wine Branch: master Commit: 3dd68caab3d39fd5cd4d3a223b696ae7d5f7e9e6 URL: https://gitlab.winehq.org/wine/wine/-/commit/3dd68caab3d39fd5cd4d3a223b696ae...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Fri Aug 12 11:32:54 2022 +0800
user32/tests: Test creating a fullscreen window spanning multiple monitors.
---
dlls/user32/tests/win.c | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index d9b1d9c2665..a99163860f4 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -9113,12 +9113,12 @@ static void test_fullscreen(void) static const DWORD t_ex_style[] = { 0, WS_EX_APPWINDOW, WS_EX_TOOLWINDOW }; + RECT rc, virtual_rect, expected_rect; WNDCLASSA cls; int timeout; HWND hwnd; int i, j; POINT pt; - RECT rc; HMONITOR hmon; LRESULT ret;
@@ -9265,6 +9265,48 @@ static void test_fullscreen(void) DestroyWindow(hwnd);
UnregisterClassA("fullscreen_class", GetModuleHandleA(NULL)); + + /* Test fullscreen windows spanning multiple monitors */ + if (GetSystemMetrics(SM_CMONITORS) > 1) + { + /* Test windows covering all monitors */ + virtual_rect.left = GetSystemMetrics(SM_XVIRTUALSCREEN); + virtual_rect.top = GetSystemMetrics(SM_YVIRTUALSCREEN); + virtual_rect.right = virtual_rect.left + GetSystemMetrics(SM_CXVIRTUALSCREEN); + virtual_rect.bottom = virtual_rect.top + GetSystemMetrics(SM_CYVIRTUALSCREEN); + + hwnd = CreateWindowA("static", NULL, WS_POPUP | WS_VISIBLE, virtual_rect.left, + virtual_rect.top, virtual_rect.right - virtual_rect.left, + virtual_rect.bottom - virtual_rect.top, NULL, NULL, NULL, NULL); + ok(!!hwnd, "CreateWindow failed, error %#lx.\n", GetLastError()); + flush_events(TRUE); + + GetWindowRect(hwnd, &rc); + todo_wine + ok(EqualRect(&rc, &virtual_rect), "Expected %s, got %s.\n", + wine_dbgstr_rect(&virtual_rect), wine_dbgstr_rect(&rc)); + DestroyWindow(hwnd); + + /* Test windows covering one monitor and 1 pixel larger on available sides */ + expected_rect = mi.rcMonitor; + InflateRect(&expected_rect, 1, 1); + IntersectRect(&expected_rect, &expected_rect, &virtual_rect); + hwnd = CreateWindowA("static", NULL, WS_POPUP | WS_VISIBLE, expected_rect.left, + expected_rect.top, expected_rect.right - expected_rect.left, + expected_rect.bottom - expected_rect.top, NULL, NULL, NULL, NULL); + ok(!!hwnd, "CreateWindow failed, error %#lx.\n", GetLastError()); + flush_events(TRUE); + + GetWindowRect(hwnd, &rc); + todo_wine + ok(EqualRect(&rc, &expected_rect), "Expected %s, got %s.\n", + wine_dbgstr_rect(&expected_rect), wine_dbgstr_rect(&rc)); + DestroyWindow(hwnd); + } + else + { + skip("This test requires at least two monitors.\n"); + } }
static BOOL test_thick_child_got_minmax;