Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- v2: Supersede 227889 and 227890. Fix a test failure for 2/2.
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 d6087873f21..63c18cd9948 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -9126,12 +9126,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;
@@ -9278,6 +9278,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 %#x.\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 %#x.\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;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=109481
Your paranoid android.
=== w1064_tsign (64 bit report) ===
user32: win.c:2996: Test failed: wait timed out win.c:2826: Test failed: expected nonzero icon win.c:2828: Test failed: got error 1402
=== debian11 (32 bit WoW report) ===
user32: win.c:11019: Test failed: Expected foreground window 00020052, got 00F600BE
=== debian11 (64 bit WoW report) ===
user32: win.c:11013: Test failed: Expected foreground window 0, got 0000000001B30042 win.c:11019: Test failed: Expected foreground window 0000000000020052, got 0000000001B30042 win.c:11036: Test failed: Expected foreground window 0000000000020052, got 0000000001B30042 win.c:11038: Test failed: GetActiveWindow() = 0000000000000000 win.c:11038: Test failed: GetFocus() = 0000000000000000 win.c:11040: Test failed: Received WM_ACTIVATEAPP(0), did not expect it. win.c:11048: Test failed: Expected foreground window 0000000000020052, got 0000000000000000 win.c:11050: Test failed: GetActiveWindow() = 0000000000000000 win.c:11050: Test failed: GetFocus() = 0000000000000000 win.c:11058: Test failed: Received WM_ACTIVATEAPP(1), did not expect it.