You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Rebase against 5e86cc0a8f37295072b03b1c13aa205ff3e6f3e4
This commit is contained in:
@@ -1,224 +0,0 @@
|
||||
From b80ed82abdd82dcf8fe40c7618db978ebb094ecc Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Wed, 19 Dec 2018 10:31:22 -0600
|
||||
Subject: [PATCH 01/15] user32/tests: Add tests for GetWindowPlacement() and
|
||||
SetWindowPlacement().
|
||||
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
dlls/user32/tests/win.c | 192 ++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 192 insertions(+)
|
||||
|
||||
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
|
||||
index 94eff5ee4f..85b2b3a514 100644
|
||||
--- a/dlls/user32/tests/win.c
|
||||
+++ b/dlls/user32/tests/win.c
|
||||
@@ -10721,6 +10721,197 @@ static void test_IsWindowEnabled(void)
|
||||
DestroyWindow(hwnd);
|
||||
}
|
||||
|
||||
+static void test_window_placement(void)
|
||||
+{
|
||||
+ RECT orig = {100, 200, 300, 400}, orig2 = {200, 300, 400, 500}, rect;
|
||||
+ WINDOWPLACEMENT wp = {sizeof(wp)};
|
||||
+ HWND hwnd;
|
||||
+ BOOL ret;
|
||||
+
|
||||
+ hwnd = CreateWindowA("MainWindowClass", "wp", WS_OVERLAPPEDWINDOW,
|
||||
+ orig.left, orig.top, orig.right - orig.left, orig.bottom - orig.top, 0, 0, 0, 0);
|
||||
+ ok(!!hwnd, "failed to create window, error %u\n", GetLastError());
|
||||
+
|
||||
+ ret = GetWindowPlacement(hwnd, &wp);
|
||||
+ ok(ret, "failed to get window placement, error %u\n", GetLastError());
|
||||
+ ok(wp.showCmd == SW_SHOWNORMAL, "got show cmd %u\n", wp.showCmd);
|
||||
+ ok(wp.ptMinPosition.x == -1 && wp.ptMinPosition.y == -1,
|
||||
+ "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
|
||||
+ ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
|
||||
+ "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
|
||||
+ ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
|
||||
+ wine_dbgstr_rect(&wp.rcNormalPosition));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_MINIMIZE);
|
||||
+
|
||||
+ ret = GetWindowPlacement(hwnd, &wp);
|
||||
+ ok(ret, "failed to get window placement, error %u\n", GetLastError());
|
||||
+ ok(!wp.flags, "got flags %#x\n", wp.flags);
|
||||
+ ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
|
||||
+ ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
|
||||
+ "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
|
||||
+ ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
|
||||
+ "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
|
||||
+ ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
|
||||
+ wine_dbgstr_rect(&wp.rcNormalPosition));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_RESTORE);
|
||||
+
|
||||
+ ret = GetWindowPlacement(hwnd, &wp);
|
||||
+ ok(ret, "failed to get window placement, error %u\n", GetLastError());
|
||||
+ ok(wp.showCmd == SW_SHOWNORMAL, "got show cmd %u\n", wp.showCmd);
|
||||
+ ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
|
||||
+ "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
|
||||
+ ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
|
||||
+ "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
|
||||
+ ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
|
||||
+ wine_dbgstr_rect(&wp.rcNormalPosition));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_MAXIMIZE);
|
||||
+
|
||||
+ ret = GetWindowPlacement(hwnd, &wp);
|
||||
+ ok(ret, "failed to get window placement, error %u\n", GetLastError());
|
||||
+ ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
|
||||
+ ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
|
||||
+ "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
|
||||
+todo_wine
|
||||
+ ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
|
||||
+ "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
|
||||
+ ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
|
||||
+ wine_dbgstr_rect(&wp.rcNormalPosition));
|
||||
+
|
||||
+ SetWindowPos(hwnd, 0, 100, 100, 100, 100, SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
+
|
||||
+ ret = GetWindowPlacement(hwnd, &wp);
|
||||
+ ok(ret, "failed to get window placement, error %u\n", GetLastError());
|
||||
+ ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
|
||||
+ ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
|
||||
+ "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
|
||||
+ ok(wp.ptMaxPosition.x == 100 && wp.ptMaxPosition.y == 100,
|
||||
+ "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
|
||||
+ ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
|
||||
+ wine_dbgstr_rect(&wp.rcNormalPosition));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_MINIMIZE);
|
||||
+
|
||||
+ ret = GetWindowPlacement(hwnd, &wp);
|
||||
+ ok(ret, "failed to get window placement, error %u\n", GetLastError());
|
||||
+ ok(wp.flags == WPF_RESTORETOMAXIMIZED, "got flags %#x\n", wp.flags);
|
||||
+ ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
|
||||
+ ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
|
||||
+ "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
|
||||
+todo_wine
|
||||
+ ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
|
||||
+ "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
|
||||
+ ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
|
||||
+ wine_dbgstr_rect(&wp.rcNormalPosition));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_RESTORE);
|
||||
+
|
||||
+ ret = GetWindowPlacement(hwnd, &wp);
|
||||
+ ok(ret, "failed to get window placement, error %u\n", GetLastError());
|
||||
+ ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
|
||||
+ ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
|
||||
+ "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
|
||||
+todo_wine
|
||||
+ ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
|
||||
+ "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
|
||||
+ ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
|
||||
+ wine_dbgstr_rect(&wp.rcNormalPosition));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_RESTORE);
|
||||
+
|
||||
+ ret = GetWindowPlacement(hwnd, &wp);
|
||||
+ ok(ret, "failed to get window placement, error %u\n", GetLastError());
|
||||
+ ok(wp.showCmd == SW_SHOWNORMAL, "got show cmd %u\n", wp.showCmd);
|
||||
+ ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
|
||||
+ "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
|
||||
+todo_wine
|
||||
+ ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
|
||||
+ "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
|
||||
+ ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
|
||||
+ wine_dbgstr_rect(&wp.rcNormalPosition));
|
||||
+
|
||||
+ wp.flags = WPF_SETMINPOSITION;
|
||||
+ wp.ptMinPosition.x = wp.ptMinPosition.y = 100;
|
||||
+ wp.ptMaxPosition.x = wp.ptMaxPosition.y = 100;
|
||||
+ wp.rcNormalPosition = orig2;
|
||||
+ ret = SetWindowPlacement(hwnd, &wp);
|
||||
+ ok(ret, "failed to set window placement, error %u\n", GetLastError());
|
||||
+
|
||||
+ ret = GetWindowPlacement(hwnd, &wp);
|
||||
+ ok(ret, "failed to get window placement, error %u\n", GetLastError());
|
||||
+ ok(wp.showCmd == SW_SHOWNORMAL, "got show cmd %u\n", wp.showCmd);
|
||||
+ ok(wp.ptMinPosition.x == 100 && wp.ptMinPosition.y == 100,
|
||||
+ "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
|
||||
+todo_wine
|
||||
+ ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
|
||||
+ "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
|
||||
+ ok(EqualRect(&wp.rcNormalPosition, &orig2), "got normal pos %s\n",
|
||||
+ wine_dbgstr_rect(&wp.rcNormalPosition));
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ ok(EqualRect(&rect, &orig2), "got window rect %s\n", wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_MINIMIZE);
|
||||
+
|
||||
+ ret = GetWindowPlacement(hwnd, &wp);
|
||||
+ ok(ret, "failed to get window placement, error %u\n", GetLastError());
|
||||
+ ok(!wp.flags, "got flags %#x\n", wp.flags);
|
||||
+ ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
|
||||
+ ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
|
||||
+ "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
|
||||
+todo_wine
|
||||
+ ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
|
||||
+ "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
|
||||
+ ok(EqualRect(&wp.rcNormalPosition, &orig2), "got normal pos %s\n",
|
||||
+ wine_dbgstr_rect(&wp.rcNormalPosition));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_RESTORE);
|
||||
+
|
||||
+ wp.flags = WPF_SETMINPOSITION;
|
||||
+ wp.showCmd = SW_MINIMIZE;
|
||||
+ wp.ptMinPosition.x = wp.ptMinPosition.y = 100;
|
||||
+ wp.ptMaxPosition.x = wp.ptMaxPosition.y = 100;
|
||||
+ wp.rcNormalPosition = orig;
|
||||
+ ret = SetWindowPlacement(hwnd, &wp);
|
||||
+ ok(ret, "failed to set window placement, error %u\n", GetLastError());
|
||||
+
|
||||
+ ret = GetWindowPlacement(hwnd, &wp);
|
||||
+ ok(ret, "failed to get window placement, error %u\n", GetLastError());
|
||||
+ ok(!wp.flags, "got flags %#x\n", wp.flags);
|
||||
+ ok(wp.showCmd == SW_SHOWMINIMIZED, "got show cmd %u\n", wp.showCmd);
|
||||
+ ok(wp.ptMinPosition.x == -32000 && wp.ptMinPosition.y == -32000,
|
||||
+ "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
|
||||
+todo_wine
|
||||
+ ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
|
||||
+ "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
|
||||
+ ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
|
||||
+ wine_dbgstr_rect(&wp.rcNormalPosition));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_RESTORE);
|
||||
+
|
||||
+ wp.flags = WPF_SETMINPOSITION;
|
||||
+ wp.showCmd = SW_MAXIMIZE;
|
||||
+ wp.ptMinPosition.x = wp.ptMinPosition.y = 100;
|
||||
+ wp.ptMaxPosition.x = wp.ptMaxPosition.y = 100;
|
||||
+ wp.rcNormalPosition = orig;
|
||||
+ ret = SetWindowPlacement(hwnd, &wp);
|
||||
+ ok(ret, "failed to set window placement, error %u\n", GetLastError());
|
||||
+
|
||||
+ ret = GetWindowPlacement(hwnd, &wp);
|
||||
+ ok(ret, "failed to get window placement, error %u\n", GetLastError());
|
||||
+ ok(wp.showCmd == SW_SHOWMAXIMIZED, "got show cmd %u\n", wp.showCmd);
|
||||
+ ok(wp.ptMinPosition.x == 100 && wp.ptMinPosition.y == 100,
|
||||
+ "got minimized pos (%d,%d)\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
|
||||
+todo_wine
|
||||
+ ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
|
||||
+ "got maximized pos (%d,%d)\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
|
||||
+ ok(EqualRect(&wp.rcNormalPosition, &orig), "got normal pos %s\n",
|
||||
+ wine_dbgstr_rect(&wp.rcNormalPosition));
|
||||
+
|
||||
+ DestroyWindow(hwnd);
|
||||
+}
|
||||
+
|
||||
START_TEST(win)
|
||||
{
|
||||
char **argv;
|
||||
@@ -10878,6 +11069,7 @@ START_TEST(win)
|
||||
test_minimize_window(hwndMain);
|
||||
test_destroy_quit();
|
||||
test_IsWindowEnabled();
|
||||
+ test_window_placement();
|
||||
|
||||
/* add the tests above this line */
|
||||
if (hhook) UnhookWindowsHookEx(hhook);
|
||||
--
|
||||
2.19.2
|
||||
|
||||
@@ -1,157 +0,0 @@
|
||||
From a2b9a0b19756843a345ed1cd0a9021f438bf2a3c Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Wed, 20 Dec 2017 14:24:50 -0600
|
||||
Subject: [PATCH 06/15] user32/tests: Add tests for maximizing and minimizing
|
||||
owned windows.
|
||||
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
dlls/user32/tests/win.c | 125 ++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 125 insertions(+)
|
||||
|
||||
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
|
||||
index 2687702ed8..f40f4057a1 100644
|
||||
--- a/dlls/user32/tests/win.c
|
||||
+++ b/dlls/user32/tests/win.c
|
||||
@@ -6680,6 +6680,130 @@ static void test_ShowWindow(void)
|
||||
flush_events(TRUE);
|
||||
}
|
||||
|
||||
+static void test_ShowWindow_owned(HWND hwndMain)
|
||||
+{
|
||||
+ MONITORINFO mon_info = {sizeof(mon_info)};
|
||||
+ RECT rect, orig, expect;
|
||||
+ BOOL ret;
|
||||
+ HWND hwnd, hwnd2;
|
||||
+ LONG style;
|
||||
+
|
||||
+ GetMonitorInfoW(MonitorFromWindow(hwndMain, MONITOR_DEFAULTTOPRIMARY), &mon_info);
|
||||
+ SetRect(&orig, 20, 20, 210, 110);
|
||||
+ hwnd = CreateWindowA("MainWindowClass", "owned", WS_CAPTION | WS_SYSMENU |
|
||||
+ WS_MINIMIZEBOX | WS_MAXIMIZEBOX,
|
||||
+ orig.left, orig.top, orig.right - orig.left,
|
||||
+ orig.bottom - orig.top, hwndMain, 0, 0, NULL);
|
||||
+ ok(!!hwnd, "failed to create window, error %u\n", GetLastError());
|
||||
+ hwnd2 = CreateWindowA("MainWindowClass", "owned2", WS_CAPTION | WS_SYSMENU |
|
||||
+ WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE,
|
||||
+ orig.left, orig.top, orig.right - orig.left,
|
||||
+ orig.bottom - orig.top, hwndMain, 0, 0, NULL);
|
||||
+ ok(!!hwnd2, "failed to create window, error %u\n", GetLastError());
|
||||
+
|
||||
+ style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(!(style & WS_VISIBLE), "window should not be visible\n");
|
||||
+ ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
||||
+ ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ ok(EqualRect(&orig, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ ret = ShowWindow(hwnd, SW_SHOW);
|
||||
+ ok(!ret, "wrong ret %d\n", ret);
|
||||
+ style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should be visible\n");
|
||||
+ ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
||||
+ ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ ok(EqualRect(&orig, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ ret = ShowWindow(hwnd, SW_MINIMIZE);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should be visible\n");
|
||||
+ ok(style & WS_MINIMIZE, "window should be minimized\n");
|
||||
+ ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ SetRect(&expect, 0, mon_info.rcWork.bottom - GetSystemMetrics(SM_CYMINIMIZED),
|
||||
+ GetSystemMetrics(SM_CXMINIMIZED), mon_info.rcWork.bottom);
|
||||
+ todo_wine
|
||||
+ ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+ /* shouldn't be able to resize minimized windows */
|
||||
+ ret = SetWindowPos(hwnd, 0, 0, 0, 200, 200, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ todo_wine
|
||||
+ ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ /* multiple minimized owned windows stack next to each other (and eventually
|
||||
+ * on top of each other) */
|
||||
+ OffsetRect(&expect, GetSystemMetrics(SM_CXMINIMIZED), 0);
|
||||
+ ret = ShowWindow(hwnd2, SW_MINIMIZE);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ style = GetWindowLongA(hwnd2, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should be visible\n");
|
||||
+ ok(style & WS_MINIMIZE, "window should be minimized\n");
|
||||
+ ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd2, &rect);
|
||||
+ todo_wine
|
||||
+ ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_RESTORE);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should be visible\n");
|
||||
+ ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
||||
+ ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ ok(EqualRect(&orig, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_MAXIMIZE);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should be visible\n");
|
||||
+ ok(!(style & WS_MINIMIZE), "window should be minimized\n");
|
||||
+ ok(style & WS_MAXIMIZE, "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ expect = mon_info.rcWork;
|
||||
+ AdjustWindowRectEx(&expect, GetWindowLongA(hwnd, GWL_STYLE) & ~WS_BORDER,
|
||||
+ 0, GetWindowLongA(hwnd, GWL_EXSTYLE));
|
||||
+ ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+ /* maximized windows can be resized */
|
||||
+ ret = SetWindowPos(hwnd, 0, 300, 300, 200, 200, SWP_NOACTIVATE | SWP_NOZORDER);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ SetRect(&expect, 300, 300, 500, 500);
|
||||
+ ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_RESTORE);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should be visible\n");
|
||||
+ ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
||||
+ ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ ok(EqualRect(&orig, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ DestroyWindow(hwnd2);
|
||||
+ DestroyWindow(hwnd);
|
||||
+}
|
||||
+
|
||||
static DWORD CALLBACK enablewindow_thread(LPVOID arg)
|
||||
{
|
||||
HWND hwnd = arg;
|
||||
@@ -11054,6 +11178,7 @@ START_TEST(win)
|
||||
test_SetWindowLong();
|
||||
test_set_window_style();
|
||||
test_ShowWindow();
|
||||
+ test_ShowWindow_owned(hwndMain);
|
||||
test_EnableWindow();
|
||||
test_gettext();
|
||||
test_GetUpdateRect();
|
||||
--
|
||||
2.19.2
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
From 703fc352f012c3edd1495937ff3b29bcbeeb90c6 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Wed, 20 Dec 2017 23:08:28 -0600
|
||||
Subject: [PATCH 07/15] user32/tests: Add tests for maximizing and minimizing
|
||||
child windows.
|
||||
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
dlls/user32/tests/win.c | 131 ++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 131 insertions(+)
|
||||
|
||||
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
|
||||
index f40f4057a1..9153789d34 100644
|
||||
--- a/dlls/user32/tests/win.c
|
||||
+++ b/dlls/user32/tests/win.c
|
||||
@@ -6804,6 +6804,136 @@ static void test_ShowWindow_owned(HWND hwndMain)
|
||||
DestroyWindow(hwnd);
|
||||
}
|
||||
|
||||
+static void test_ShowWindow_child(HWND hwndMain)
|
||||
+{
|
||||
+ RECT rect, orig, expect;
|
||||
+ BOOL ret;
|
||||
+ HWND hwnd, hwnd2;
|
||||
+ LONG style;
|
||||
+ POINT pt = {0};
|
||||
+
|
||||
+ SetRect(&orig, 20, 20, 210, 110);
|
||||
+ hwnd = CreateWindowA("MainWindowClass", "child", WS_CAPTION | WS_SYSMENU |
|
||||
+ WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CHILD,
|
||||
+ orig.left, orig.top, orig.right - orig.left,
|
||||
+ orig.bottom - orig.top, hwndMain, 0, 0, NULL);
|
||||
+ ok(!!hwnd, "failed to create window, error %u\n", GetLastError());
|
||||
+ hwnd2 = CreateWindowA("MainWindowClass", "child2", WS_CAPTION | WS_SYSMENU |
|
||||
+ WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CHILD | WS_VISIBLE,
|
||||
+ orig.left, orig.top, orig.right - orig.left,
|
||||
+ orig.bottom - orig.top, hwndMain, 0, 0, NULL);
|
||||
+ ok(!!hwnd2, "failed to create window, error %u\n", GetLastError());
|
||||
+
|
||||
+ ClientToScreen(hwndMain, &pt);
|
||||
+ OffsetRect(&orig, pt.x, pt.y);
|
||||
+
|
||||
+ style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(!(style & WS_VISIBLE), "window should not be visible\n");
|
||||
+ ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
||||
+ ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ ok(EqualRect(&orig, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ ret = ShowWindow(hwnd, SW_SHOW);
|
||||
+ ok(!ret, "wrong ret %d\n", ret);
|
||||
+ style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should be visible\n");
|
||||
+ ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
||||
+ ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ ok(EqualRect(&orig, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ ret = ShowWindow(hwnd, SW_MINIMIZE);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should be visible\n");
|
||||
+ ok(style & WS_MINIMIZE, "window should be minimized\n");
|
||||
+ ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ GetClientRect(hwndMain, &expect);
|
||||
+ SetRect(&expect, 0, expect.bottom - GetSystemMetrics(SM_CYMINIMIZED),
|
||||
+ GetSystemMetrics(SM_CXMINIMIZED), expect.bottom);
|
||||
+ OffsetRect(&expect, pt.x, pt.y);
|
||||
+ todo_wine
|
||||
+ ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+ /* shouldn't be able to resize minimized windows */
|
||||
+ ret = SetWindowPos(hwnd, 0, 0, 0, 200, 200, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ todo_wine
|
||||
+ ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ /* multiple minimized children also stack; here the parent is too small to
|
||||
+ * fit more than one per row */
|
||||
+ OffsetRect(&expect, 0, -GetSystemMetrics(SM_CYMINIMIZED));
|
||||
+ ret = ShowWindow(hwnd2, SW_MINIMIZE);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ style = GetWindowLongA(hwnd2, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should be visible\n");
|
||||
+ ok(style & WS_MINIMIZE, "window should be minimized\n");
|
||||
+ ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd2, &rect);
|
||||
+ todo_wine
|
||||
+ ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_RESTORE);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should be visible\n");
|
||||
+ ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
||||
+ ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ ok(EqualRect(&orig, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_MAXIMIZE);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should be visible\n");
|
||||
+ ok(!(style & WS_MINIMIZE), "window should be minimized\n");
|
||||
+ ok(style & WS_MAXIMIZE, "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ GetClientRect(hwndMain, &expect);
|
||||
+ AdjustWindowRectEx(&expect, GetWindowLongA(hwnd, GWL_STYLE) & ~WS_BORDER,
|
||||
+ 0, GetWindowLongA(hwnd, GWL_EXSTYLE));
|
||||
+ OffsetRect(&expect, pt.x, pt.y);
|
||||
+ ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+ /* maximized windows can be resized */
|
||||
+ ret = SetWindowPos(hwnd, 0, 300, 300, 200, 200, SWP_NOACTIVATE | SWP_NOZORDER);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ SetRect(&expect, 300, 300, 500, 500);
|
||||
+ OffsetRect(&expect, pt.x, pt.y);
|
||||
+ ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_RESTORE);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should be visible\n");
|
||||
+ ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
||||
+ ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ ok(EqualRect(&orig, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ DestroyWindow(hwnd2);
|
||||
+ DestroyWindow(hwnd);
|
||||
+}
|
||||
+
|
||||
static DWORD CALLBACK enablewindow_thread(LPVOID arg)
|
||||
{
|
||||
HWND hwnd = arg;
|
||||
@@ -11179,6 +11309,7 @@ START_TEST(win)
|
||||
test_set_window_style();
|
||||
test_ShowWindow();
|
||||
test_ShowWindow_owned(hwndMain);
|
||||
+ test_ShowWindow_child(hwndMain);
|
||||
test_EnableWindow();
|
||||
test_gettext();
|
||||
test_GetUpdateRect();
|
||||
--
|
||||
2.19.2
|
||||
|
||||
@@ -1,159 +0,0 @@
|
||||
From 63f66f2673889555c1483d5d52cae3a639084f43 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Mon, 17 Dec 2018 23:23:27 -0600
|
||||
Subject: [PATCH 08/15] user32/tests: Add tests for maximizing and minimizing
|
||||
MDI child windows.
|
||||
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
dlls/user32/tests/win.c | 127 ++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 127 insertions(+)
|
||||
|
||||
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
|
||||
index 9153789d34..0026454838 100644
|
||||
--- a/dlls/user32/tests/win.c
|
||||
+++ b/dlls/user32/tests/win.c
|
||||
@@ -6934,6 +6934,132 @@ static void test_ShowWindow_child(HWND hwndMain)
|
||||
DestroyWindow(hwnd);
|
||||
}
|
||||
|
||||
+static void test_ShowWindow_mdichild(HWND hwndMain)
|
||||
+{
|
||||
+ RECT rect, orig, expect;
|
||||
+ BOOL ret;
|
||||
+ HWND mdiclient, hwnd, hwnd2;
|
||||
+ LONG style;
|
||||
+ POINT pt = {0};
|
||||
+ CLIENTCREATESTRUCT mdi_client_cs = {0,1};
|
||||
+
|
||||
+ SetRect(&orig, 20, 20, 210, 110);
|
||||
+ GetClientRect(hwndMain, &rect);
|
||||
+ mdiclient = CreateWindowA("mdiclient", "MDI client", WS_CHILD,
|
||||
+ rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top,
|
||||
+ hwndMain, 0, 0, &mdi_client_cs);
|
||||
+ ok(!!mdiclient, "failed to create window, error %u\n", GetLastError());
|
||||
+ hwnd = CreateWindowExA(WS_EX_MDICHILD, "MainWindowClass", "MDI child",
|
||||
+ WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX,
|
||||
+ orig.left, orig.top, orig.right - orig.left,
|
||||
+ orig.bottom - orig.top, mdiclient, 0, 0, NULL);
|
||||
+ ok(!!hwnd, "failed to create window, error %u\n", GetLastError());
|
||||
+ hwnd2 = CreateWindowExA(WS_EX_MDICHILD, "MainWindowClass", "MDI child 2",
|
||||
+ WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX,
|
||||
+ orig.left, orig.top, orig.right - orig.left,
|
||||
+ orig.bottom - orig.top, mdiclient, 0, 0, NULL);
|
||||
+ ok(!!hwnd2, "failed to create window, error %u\n", GetLastError());
|
||||
+
|
||||
+ ClientToScreen(hwndMain, &pt);
|
||||
+ OffsetRect(&orig, pt.x, pt.y);
|
||||
+
|
||||
+ style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should not be visible\n");
|
||||
+ ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
||||
+ ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ ok(EqualRect(&orig, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ ret = ShowWindow(hwnd, SW_MINIMIZE);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should be visible\n");
|
||||
+ ok(style & WS_MINIMIZE, "window should be minimized\n");
|
||||
+ ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ GetClientRect(hwndMain, &expect);
|
||||
+ SetRect(&expect, 0, expect.bottom - GetSystemMetrics(SM_CYMINIMIZED),
|
||||
+ GetSystemMetrics(SM_CXMINIMIZED), expect.bottom);
|
||||
+ OffsetRect(&expect, pt.x, pt.y);
|
||||
+ todo_wine
|
||||
+ ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+ /* shouldn't be able to resize minimized windows */
|
||||
+ ret = SetWindowPos(hwnd, 0, 0, 0, 200, 200, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ todo_wine
|
||||
+ ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ /* multiple minimized children also stack; here the parent is too small to
|
||||
+ * fit more than one per row */
|
||||
+ OffsetRect(&expect, 0, -GetSystemMetrics(SM_CYMINIMIZED));
|
||||
+ ret = ShowWindow(hwnd2, SW_MINIMIZE);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ style = GetWindowLongA(hwnd2, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should be visible\n");
|
||||
+ ok(style & WS_MINIMIZE, "window should be minimized\n");
|
||||
+ ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd2, &rect);
|
||||
+ todo_wine
|
||||
+ ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_RESTORE);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should be visible\n");
|
||||
+ ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
||||
+ ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ ok(EqualRect(&orig, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_MAXIMIZE);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should be visible\n");
|
||||
+ ok(!(style & WS_MINIMIZE), "window should be minimized\n");
|
||||
+ ok(style & WS_MAXIMIZE, "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ GetClientRect(hwndMain, &expect);
|
||||
+ AdjustWindowRectEx(&expect, GetWindowLongA(hwnd, GWL_STYLE) & ~WS_BORDER,
|
||||
+ 0, GetWindowLongA(hwnd, GWL_EXSTYLE));
|
||||
+ OffsetRect(&expect, pt.x, pt.y);
|
||||
+ ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+ /* maximized windows can be resized */
|
||||
+ ret = SetWindowPos(hwnd, 0, 300, 300, 200, 200, SWP_NOACTIVATE | SWP_NOZORDER);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ SetRect(&expect, 300, 300, 500, 500);
|
||||
+ OffsetRect(&expect, pt.x, pt.y);
|
||||
+ ok(EqualRect(&expect, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ ShowWindow(hwnd, SW_RESTORE);
|
||||
+ ok(ret, "wrong ret %d\n", ret);
|
||||
+ style = GetWindowLongA(hwnd, GWL_STYLE);
|
||||
+ ok(!(style & WS_DISABLED), "window should not be disabled\n");
|
||||
+ ok(style & WS_VISIBLE, "window should be visible\n");
|
||||
+ ok(!(style & WS_MINIMIZE), "window should not be minimized\n");
|
||||
+ ok(!(style & WS_MAXIMIZE), "window should not be maximized\n");
|
||||
+ GetWindowRect(hwnd, &rect);
|
||||
+ ok(EqualRect(&orig, &rect), "expected %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&orig), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ DestroyWindow(hwnd2);
|
||||
+ DestroyWindow(hwnd);
|
||||
+ DestroyWindow(mdiclient);
|
||||
+}
|
||||
+
|
||||
static DWORD CALLBACK enablewindow_thread(LPVOID arg)
|
||||
{
|
||||
HWND hwnd = arg;
|
||||
@@ -11310,6 +11436,7 @@ START_TEST(win)
|
||||
test_ShowWindow();
|
||||
test_ShowWindow_owned(hwndMain);
|
||||
test_ShowWindow_child(hwndMain);
|
||||
+ test_ShowWindow_mdichild(hwndMain);
|
||||
test_EnableWindow();
|
||||
test_gettext();
|
||||
test_GetUpdateRect();
|
||||
--
|
||||
2.19.2
|
||||
|
||||
@@ -1,192 +0,0 @@
|
||||
From 5716e0d868c32fc287d2ae7779521eff7b2f722b Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <z.figura12@gmail.com>
|
||||
Date: Tue, 18 Dec 2018 17:53:38 -0600
|
||||
Subject: [PATCH 09/15] user32/tests: Add tests for ArrangeIconicWindows().
|
||||
|
||||
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
|
||||
---
|
||||
dlls/user32/tests/win.c | 161 ++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 161 insertions(+)
|
||||
|
||||
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
|
||||
index 0026454838..a1224557ab 100644
|
||||
--- a/dlls/user32/tests/win.c
|
||||
+++ b/dlls/user32/tests/win.c
|
||||
@@ -11302,6 +11302,166 @@ todo_wine
|
||||
DestroyWindow(hwnd);
|
||||
}
|
||||
|
||||
+static void test_arrange_iconic_windows(void)
|
||||
+{
|
||||
+ MINIMIZEDMETRICS mm = {sizeof(mm)}, oldmm = {sizeof(oldmm)};
|
||||
+ RECT orig = {100, 200, 300, 400}, rect, expect, parent_rect;
|
||||
+ POINT pt = {0};
|
||||
+ HWND parent, hwnds[10];
|
||||
+ UINT ret;
|
||||
+ int i, row, col;
|
||||
+
|
||||
+ parent = CreateWindowA("MainWindowClass", "parent", WS_OVERLAPPEDWINDOW,
|
||||
+ 100, 200, 500, 300, NULL, 0, 0, NULL);
|
||||
+ ok(!!parent, "failed to create window, error %u\n", GetLastError());
|
||||
+
|
||||
+ GetClientRect(parent, &parent_rect);
|
||||
+ ClientToScreen(parent, &pt);
|
||||
+ SystemParametersInfoA(SPI_GETMINIMIZEDMETRICS, sizeof(oldmm), &oldmm, 0);
|
||||
+
|
||||
+ mm.iWidth = 100;
|
||||
+ mm.iHorzGap = 40;
|
||||
+ mm.iVertGap = 3;
|
||||
+ mm.iArrange = ARW_TOPLEFT | ARW_RIGHT;
|
||||
+ ret = SystemParametersInfoA(SPI_SETMINIMIZEDMETRICS, sizeof(mm), &mm, 0);
|
||||
+ ok(ret, "failed to set minimized metrics, error %u\n", GetLastError());
|
||||
+
|
||||
+ SetLastError(0xdeadbeef);
|
||||
+ ret = ArrangeIconicWindows(parent);
|
||||
+todo_wine
|
||||
+ ok(!ret, "wrong ret %u\n", ret);
|
||||
+ ok(GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError());
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(hwnds); ++i)
|
||||
+ {
|
||||
+ hwnds[i] = CreateWindowA("MainWindowClass", "child", WS_CHILD |
|
||||
+ WS_OVERLAPPEDWINDOW, orig.left, orig.top, orig.right - orig.left,
|
||||
+ orig.bottom - orig.top, parent, 0, 0, NULL);
|
||||
+ ok(!!hwnds[i], "failed to create window %u, error %u\n", i, GetLastError());
|
||||
+ }
|
||||
+
|
||||
+ SetLastError(0xdeadbeef);
|
||||
+ ret = ArrangeIconicWindows(parent);
|
||||
+todo_wine
|
||||
+ ok(!ret, "wrong ret %u\n", ret);
|
||||
+ ok(GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError());
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(hwnds); ++i)
|
||||
+ {
|
||||
+ GetWindowRect(hwnds[i], &rect);
|
||||
+ expect = orig;
|
||||
+ OffsetRect(&expect, pt.x, pt.y);
|
||||
+ ok(EqualRect(&rect, &expect), "hwnd %u: expected rect %s, got %s\n", i,
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+ }
|
||||
+
|
||||
+ ShowWindow(hwnds[0], SW_MINIMIZE);
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(hwnds); ++i)
|
||||
+ {
|
||||
+ ret = SetWindowPos(hwnds[i], 0, orig.left, orig.top, 0, 0,
|
||||
+ SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
+ ok(ret, "hwnd %u: failed to move window, error %u\n", i, GetLastError());
|
||||
+ }
|
||||
+
|
||||
+ ret = ArrangeIconicWindows(parent);
|
||||
+todo_wine
|
||||
+ ok(ret == 1, "wrong ret %u\n", ret);
|
||||
+
|
||||
+ GetWindowRect(hwnds[0], &rect);
|
||||
+ SetRect(&expect, 0, 0, GetSystemMetrics(SM_CXMINIMIZED), GetSystemMetrics(SM_CYMINIMIZED));
|
||||
+ OffsetRect(&expect, mm.iHorzGap, mm.iVertGap);
|
||||
+ OffsetRect(&expect, pt.x, pt.y);
|
||||
+todo_wine
|
||||
+ ok(EqualRect(&rect, &expect), "expected rect %s, got %s\n",
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ for (i = 1; i < ARRAY_SIZE(hwnds); ++i)
|
||||
+ {
|
||||
+ GetWindowRect(hwnds[i], &rect);
|
||||
+ expect = orig;
|
||||
+ OffsetRect(&expect, pt.x, pt.y);
|
||||
+ ok(EqualRect(&rect, &expect), "hwnd %u: expected rect %s, got %s\n", i,
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(hwnds); ++i)
|
||||
+ {
|
||||
+ ShowWindow(hwnds[i], SW_MINIMIZE);
|
||||
+ ret = SetWindowPos(hwnds[i], 0, orig.left, orig.top, 0, 0,
|
||||
+ SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
+ ok(ret, "hwnd %u: failed to move window, error %u\n", i, GetLastError());
|
||||
+ }
|
||||
+
|
||||
+ ret = ArrangeIconicWindows(parent);
|
||||
+todo_wine
|
||||
+ ok(ret == 10, "wrong ret %u\n", ret);
|
||||
+
|
||||
+ col = mm.iHorzGap;
|
||||
+ row = mm.iVertGap;
|
||||
+ for (i = 0; i < ARRAY_SIZE(hwnds); ++i)
|
||||
+ {
|
||||
+ if (col + GetSystemMetrics(SM_CXMINIMIZED) > parent_rect.right - parent_rect.left)
|
||||
+ {
|
||||
+ col = mm.iHorzGap;
|
||||
+ row += GetSystemMetrics(SM_CYMINIMIZED) + mm.iVertGap;
|
||||
+ }
|
||||
+
|
||||
+ GetWindowRect(hwnds[i], &rect);
|
||||
+ SetRect(&expect, col, row, col + GetSystemMetrics(SM_CXMINIMIZED),
|
||||
+ row + GetSystemMetrics(SM_CYMINIMIZED));
|
||||
+ OffsetRect(&expect, pt.x, pt.y);
|
||||
+todo_wine
|
||||
+ ok(EqualRect(&rect, &expect), "hwnd %u: expected rect %s, got %s\n", i,
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ col += GetSystemMetrics(SM_CXMINIMIZED) + mm.iHorzGap;
|
||||
+ }
|
||||
+
|
||||
+ mm.iArrange = ARW_BOTTOMRIGHT | ARW_UP;
|
||||
+ mm.iVertGap = 10;
|
||||
+ ret = SystemParametersInfoA(SPI_SETMINIMIZEDMETRICS, sizeof(mm), &mm, 0);
|
||||
+ ok(ret, "failed to set minimized metrics, error %u\n", GetLastError());
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(hwnds); ++i)
|
||||
+ {
|
||||
+ ret = SetWindowPos(hwnds[i], 0, orig.left, orig.top, 0, 0,
|
||||
+ SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
+ ok(ret, "hwnd %u: failed to move window, error %u\n", i, GetLastError());
|
||||
+ }
|
||||
+
|
||||
+ ret = ArrangeIconicWindows(parent);
|
||||
+todo_wine
|
||||
+ ok(ret == 10, "wrong ret %u\n", ret);
|
||||
+
|
||||
+ col = parent_rect.right - mm.iHorzGap;
|
||||
+ row = parent_rect.bottom - mm.iVertGap;
|
||||
+ for (i = 0; i < ARRAY_SIZE(hwnds); ++i)
|
||||
+ {
|
||||
+ if (row - GetSystemMetrics(SM_CYMINIMIZED) < parent_rect.top)
|
||||
+ {
|
||||
+ row = parent_rect.bottom - mm.iVertGap;
|
||||
+ col -= GetSystemMetrics(SM_CXMINIMIZED) + mm.iHorzGap;
|
||||
+ }
|
||||
+
|
||||
+ GetWindowRect(hwnds[i], &rect);
|
||||
+ SetRect(&expect, col - GetSystemMetrics(SM_CXMINIMIZED),
|
||||
+ row - GetSystemMetrics(SM_CYMINIMIZED), col, row);
|
||||
+ OffsetRect(&expect, pt.x, pt.y);
|
||||
+todo_wine
|
||||
+ ok(EqualRect(&rect, &expect), "hwnd %u: expected rect %s, got %s\n", i,
|
||||
+ wine_dbgstr_rect(&expect), wine_dbgstr_rect(&rect));
|
||||
+
|
||||
+ row -= GetSystemMetrics(SM_CYMINIMIZED) + mm.iVertGap;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(hwnds); ++i)
|
||||
+ DestroyWindow(hwnds[i]);
|
||||
+
|
||||
+ ret = SystemParametersInfoA(SPI_SETMINIMIZEDMETRICS, sizeof(oldmm), &oldmm, 0);
|
||||
+ ok(ret, "failed to restore minimized metrics, error %u\n", GetLastError());
|
||||
+}
|
||||
+
|
||||
START_TEST(win)
|
||||
{
|
||||
char **argv;
|
||||
@@ -11463,6 +11623,7 @@ START_TEST(win)
|
||||
test_destroy_quit();
|
||||
test_IsWindowEnabled();
|
||||
test_window_placement();
|
||||
+ test_arrange_iconic_windows();
|
||||
|
||||
/* add the tests above this line */
|
||||
if (hhook) UnhookWindowsHookEx(hhook);
|
||||
--
|
||||
2.19.2
|
||||
|
||||
Reference in New Issue
Block a user