Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/d3d9/tests/device.c | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 3ef9361886d..c480a9d163e 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -14572,10 +14572,10 @@ static void test_window_position(void) { unsigned int adapter_idx, adapter_count; struct device_desc device_desc; + RECT window_rect, new_rect; IDirect3DDevice9 *device; MONITORINFO monitor_info; HMONITOR monitor; - RECT window_rect; IDirect3D9 *d3d; HWND window; HRESULT hr; @@ -14612,6 +14612,42 @@ static void test_window_position(void) "Adapter %u: Expect window rect %s, got %s.\n", adapter_idx, wine_dbgstr_rect(&monitor_info.rcMonitor), wine_dbgstr_rect(&window_rect));
+ new_rect = window_rect; + --new_rect.right; + --new_rect.bottom; + + ret = MoveWindow(window, new_rect.left, new_rect.top, new_rect.right - new_rect.left, + new_rect.bottom - new_rect.top, TRUE); + ok(ret, "Got unexpected ret %#x, error %#x, Adapter %u.\n", ret, GetLastError(), adapter_idx); + ret = GetWindowRect(window, &window_rect); + ok(ret, "Got unexpected ret %#x, error %#x, Adapter %u.\n", ret, GetLastError(), adapter_idx); + ok(EqualRect(&window_rect, &new_rect), + "Adapter %u: Expect window rect %s, got %s.\n", adapter_idx, + wine_dbgstr_rect(&monitor_info.rcMonitor), wine_dbgstr_rect(&window_rect)); + /* After processing window events window rectangle gets restored. But only once, the size set + * on the second resize remains. */ + flush_events(); + ret = GetWindowRect(window, &window_rect); + ok(ret, "Got unexpected ret %#x, error %#x, Adapter %u.\n", ret, GetLastError(), adapter_idx); + todo_wine ok(EqualRect(&window_rect, &monitor_info.rcMonitor), + "Adapter %u: Expect window rect %s, got %s.\n", adapter_idx, + wine_dbgstr_rect(&monitor_info.rcMonitor), wine_dbgstr_rect(&window_rect)); + + ret = MoveWindow(window, new_rect.left, new_rect.top, new_rect.right - new_rect.left, + new_rect.bottom - new_rect.top, TRUE); + ok(ret, "Got unexpected ret %#x, error %#x, Adapter %u.\n", ret, GetLastError(), adapter_idx); + ret = GetWindowRect(window, &window_rect); + ok(ret, "Got unexpected ret %#x, error %#x, Adapter %u.\n", ret, GetLastError(), adapter_idx); + ok(EqualRect(&window_rect, &new_rect), + "Adapter %u: Expect window rect %s, got %s.\n", adapter_idx, + wine_dbgstr_rect(&monitor_info.rcMonitor), wine_dbgstr_rect(&window_rect)); + flush_events(); + ret = GetWindowRect(window, &window_rect); + ok(ret, "Got unexpected ret %#x, error %#x, Adapter %u.\n", ret, GetLastError(), adapter_idx); + ok(EqualRect(&window_rect, &new_rect), + "Adapter %u: Expect window rect %s, got %s.\n", adapter_idx, + wine_dbgstr_rect(&monitor_info.rcMonitor), wine_dbgstr_rect(&window_rect)); + /* Device resets should restore the window rectangle to fit the whole monitor */ ret = SetWindowPos(window, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOSIZE); ok(ret, "Adapter %u: SetWindowPos failed, error %#x.\n", adapter_idx, GetLastError());
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=102943
Your paranoid android.
=== w10pro64_he (64 bit report) ===
d3d9: device.c:5260: Test failed: Didn't receive MOUSEMOVE 3 (125, 125).
Though for what it's worth, note that this test has equivalents in other D3D versions as well.