Fixes a regression introduced by f90d607c67768f19e36d9d74b498594252faa3fd.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50370 Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
The current tests were testing a hidden window only, which ddraw treats as "inactive" (but not d3d8/d3d9ex). Tests were added to show that even visible windows, but not foreground, are not set to topmost, while foreground ones are.
This is ddraw specific. d3d8 and d3d9ex treat hidden windows as "active" for the purposes of window changes (so only visible windows, if inactive, prevent changes). We have existing tests for that.
Unfortunately, most of the tests are still todo_wine, even though the WS_EX_TOPMOST style matches (except when exiting, that's fixed on 3rd patch). That's because we don't have WS_EX_WINDOWEDGE on fullscreen windows (long-standing issue), but the topmost bit is set correctly.
dlls/ddraw/ddraw.c | 6 ++-- dlls/ddraw/tests/ddraw1.c | 67 ++++++++++++++++++++++++++++++++++++++- dlls/ddraw/tests/ddraw2.c | 67 ++++++++++++++++++++++++++++++++++++++- dlls/ddraw/tests/ddraw4.c | 67 ++++++++++++++++++++++++++++++++++++++- dlls/ddraw/tests/ddraw7.c | 67 ++++++++++++++++++++++++++++++++++++++- 5 files changed, 268 insertions(+), 6 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 5b70bb4..77172d4 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -583,8 +583,10 @@ static HRESULT ddraw_attach_d3d_device(struct ddraw *ddraw, HWND window, swapchain_desc.swap_effect = WINED3D_SWAP_EFFECT_DISCARD; swapchain_desc.device_window = window; swapchain_desc.windowed = windowed; - swapchain_desc.flags = WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH - | WINED3D_SWAPCHAIN_IMPLICIT | WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES; + swapchain_desc.flags = WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH | WINED3D_SWAPCHAIN_IMPLICIT; + + if (window != GetForegroundWindow()) + swapchain_desc.flags |= WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES;
if (ddraw->flags & DDRAW_NO3D) return wined3d_swapchain_create(ddraw->wined3d_device, &swapchain_desc, diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index efbecf0..137469c 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -2585,14 +2585,16 @@ static void test_window_style(void) { LONG style, exstyle, tmp, expected_style; RECT fullscreen_rect, r; + HWND window, window2; IDirectDraw *ddraw; - HWND window; HRESULT hr; ULONG ref; BOOL ret;
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, 0, 0); + window2 = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 50, 50, 0, 0, 0, 0); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n");
@@ -2636,6 +2638,68 @@ static void test_window_style(void) tmp = GetWindowLongA(window, GWL_EXSTYLE); ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp);
+ ShowWindow(window, SW_SHOW); + ret = SetForegroundWindow(GetDesktopWindow()); + ok(ret, "Failed to set foreground window.\n"); + SetActiveWindow(window); + ok(GetActiveWindow() == window, "Unexpected active window.\n"); + hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + + GetWindowRect(window, &r); + ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", + wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); + + hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + SetWindowPos(window, NULL, 0, 0, 100, 100, SWP_NOZORDER | SWP_NOACTIVATE); + GetWindowRect(window, &r); + ok(!EqualRect(&r, &fullscreen_rect), "Window resize failed? got %s.\n", + wine_dbgstr_rect(&r)); + + ret = SetForegroundWindow(window2); + ok(ret, "Failed to set foreground window.\n"); + hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + + GetWindowRect(window, &r); + ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", + wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); + + ret = SetForegroundWindow(window); + ok(ret, "Failed to set foreground window.\n"); + hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + ShowWindow(window, SW_HIDE); + hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ShowWindow(window, SW_SHOW); hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); @@ -2659,6 +2723,7 @@ static void test_window_style(void) ref = IDirectDraw_Release(ddraw); ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref);
+ DestroyWindow(window2); DestroyWindow(window); }
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 65ac21d..f3801ef 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -2663,14 +2663,16 @@ static void test_window_style(void) { LONG style, exstyle, tmp, expected_style; RECT fullscreen_rect, r; + HWND window, window2; IDirectDraw2 *ddraw; - HWND window; HRESULT hr; ULONG ref; BOOL ret;
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, 0, 0); + window2 = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 50, 50, 0, 0, 0, 0); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n");
@@ -2714,6 +2716,68 @@ static void test_window_style(void) tmp = GetWindowLongA(window, GWL_EXSTYLE); ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp);
+ ShowWindow(window, SW_SHOW); + ret = SetForegroundWindow(GetDesktopWindow()); + ok(ret, "Failed to set foreground window.\n"); + SetActiveWindow(window); + ok(GetActiveWindow() == window, "Unexpected active window.\n"); + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + + GetWindowRect(window, &r); + ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", + wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); + + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + SetWindowPos(window, NULL, 0, 0, 100, 100, SWP_NOZORDER | SWP_NOACTIVATE); + GetWindowRect(window, &r); + ok(!EqualRect(&r, &fullscreen_rect), "Window resize failed? got %s.\n", + wine_dbgstr_rect(&r)); + + ret = SetForegroundWindow(window2); + ok(ret, "Failed to set foreground window.\n"); + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + + GetWindowRect(window, &r); + ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", + wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); + + ret = SetForegroundWindow(window); + ok(ret, "Failed to set foreground window.\n"); + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + ShowWindow(window, SW_HIDE); + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ShowWindow(window, SW_SHOW); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); @@ -2737,6 +2801,7 @@ static void test_window_style(void) ref = IDirectDraw2_Release(ddraw); ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref);
+ DestroyWindow(window2); DestroyWindow(window); }
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index ce2333d..9c22103 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -2899,14 +2899,16 @@ static void test_window_style(void) { LONG style, exstyle, tmp, expected_style; RECT fullscreen_rect, r; + HWND window, window2; IDirectDraw4 *ddraw; - HWND window; HRESULT hr; ULONG ref; BOOL ret;
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, 0, 0); + window2 = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 50, 50, 0, 0, 0, 0); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n");
@@ -2950,6 +2952,68 @@ static void test_window_style(void) tmp = GetWindowLongA(window, GWL_EXSTYLE); ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp);
+ ShowWindow(window, SW_SHOW); + ret = SetForegroundWindow(GetDesktopWindow()); + ok(ret, "Failed to set foreground window.\n"); + SetActiveWindow(window); + ok(GetActiveWindow() == window, "Unexpected active window.\n"); + hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + + GetWindowRect(window, &r); + ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", + wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); + + hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + SetWindowPos(window, NULL, 0, 0, 100, 100, SWP_NOZORDER | SWP_NOACTIVATE); + GetWindowRect(window, &r); + ok(!EqualRect(&r, &fullscreen_rect), "Window resize failed? got %s.\n", + wine_dbgstr_rect(&r)); + + ret = SetForegroundWindow(window2); + ok(ret, "Failed to set foreground window.\n"); + hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + + GetWindowRect(window, &r); + ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", + wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); + + ret = SetForegroundWindow(window); + ok(ret, "Failed to set foreground window.\n"); + hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + ShowWindow(window, SW_HIDE); + hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ShowWindow(window, SW_SHOW); hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); @@ -2973,6 +3037,7 @@ static void test_window_style(void) ref = IDirectDraw4_Release(ddraw); ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref);
+ DestroyWindow(window2); DestroyWindow(window); }
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 4cf57bf..7cadb88 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -2564,14 +2564,16 @@ static void test_window_style(void) { LONG style, exstyle, tmp, expected_style; RECT fullscreen_rect, r; + HWND window, window2; IDirectDraw7 *ddraw; - HWND window; HRESULT hr; ULONG ref; BOOL ret;
window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, 0, 0); + window2 = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 50, 50, 0, 0, 0, 0); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n");
@@ -2615,6 +2617,68 @@ static void test_window_style(void) tmp = GetWindowLongA(window, GWL_EXSTYLE); ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp);
+ ShowWindow(window, SW_SHOW); + ret = SetForegroundWindow(GetDesktopWindow()); + ok(ret, "Failed to set foreground window.\n"); + SetActiveWindow(window); + ok(GetActiveWindow() == window, "Unexpected active window.\n"); + hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + + GetWindowRect(window, &r); + ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", + wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); + + hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + SetWindowPos(window, NULL, 0, 0, 100, 100, SWP_NOZORDER | SWP_NOACTIVATE); + GetWindowRect(window, &r); + ok(!EqualRect(&r, &fullscreen_rect), "Window resize failed? got %s.\n", + wine_dbgstr_rect(&r)); + + ret = SetForegroundWindow(window2); + ok(ret, "Failed to set foreground window.\n"); + hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + + GetWindowRect(window, &r); + ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", + wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); + + ret = SetForegroundWindow(window); + ok(ret, "Failed to set foreground window.\n"); + hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + ShowWindow(window, SW_HIDE); + hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ShowWindow(window, SW_SHOW); hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); @@ -2638,6 +2702,7 @@ static void test_window_style(void) ref = IDirectDraw7_Release(ddraw); ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref);
+ DestroyWindow(window2); DestroyWindow(window); }
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/ddraw/ddraw.c | 14 ++++----- dlls/ddraw/tests/ddraw1.c | 65 +++++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw2.c | 65 +++++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw4.c | 65 +++++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw7.c | 65 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 267 insertions(+), 7 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 77172d4..ff78dae 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -559,7 +559,7 @@ static HRESULT ddraw_set_focus_window(struct ddraw *ddraw, HWND window) }
static HRESULT ddraw_attach_d3d_device(struct ddraw *ddraw, HWND window, - BOOL windowed, struct wined3d_swapchain **wined3d_swapchain) + DWORD cooplevel, struct wined3d_swapchain **wined3d_swapchain) { struct wined3d_swapchain_desc swapchain_desc; struct wined3d_display_mode mode; @@ -582,10 +582,10 @@ static HRESULT ddraw_attach_d3d_device(struct ddraw *ddraw, HWND window, swapchain_desc.backbuffer_count = 1; swapchain_desc.swap_effect = WINED3D_SWAP_EFFECT_DISCARD; swapchain_desc.device_window = window; - swapchain_desc.windowed = windowed; + swapchain_desc.windowed = !(cooplevel & DDSCL_FULLSCREEN); swapchain_desc.flags = WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH | WINED3D_SWAPCHAIN_IMPLICIT;
- if (window != GetForegroundWindow()) + if ((cooplevel & DDSCL_NOWINDOWCHANGES) || window != GetForegroundWindow()) swapchain_desc.flags |= WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES;
if (ddraw->flags & DDRAW_NO3D) @@ -642,7 +642,7 @@ static HRESULT ddraw_attach_d3d_device(struct ddraw *ddraw, HWND window, return DD_OK; }
-static HRESULT ddraw_create_swapchain(struct ddraw *ddraw, HWND window, BOOL windowed) +static HRESULT ddraw_create_swapchain(struct ddraw *ddraw, HWND window, DWORD cooplevel) { HRESULT hr;
@@ -652,7 +652,7 @@ static HRESULT ddraw_create_swapchain(struct ddraw *ddraw, HWND window, BOOL win return E_FAIL; }
- if (FAILED(hr = ddraw_attach_d3d_device(ddraw, window, windowed, &ddraw->wined3d_swapchain))) + if (FAILED(hr = ddraw_attach_d3d_device(ddraw, window, cooplevel, &ddraw->wined3d_swapchain))) { ERR("Failed to create swapchain, hr %#x.\n", hr); return hr; @@ -778,7 +778,7 @@ static HRESULT WINAPI ddraw1_RestoreDisplayMode(IDirectDraw *iface) * Unsure about this: DDSCL_FPUSETUP * * These don't seem very important for wine: - * DDSCL_ALLOWREBOOT, DDSCL_NOWINDOWCHANGES, DDSCL_ALLOWMODEX + * DDSCL_ALLOWREBOOT, DDSCL_ALLOWMODEX * * Returns: * DD_OK if the cooperative level was set successfully @@ -947,7 +947,7 @@ static HRESULT ddraw_set_cooperative_level(struct ddraw *ddraw, HWND window, ddraw_destroy_swapchain(ddraw); }
- if (FAILED(hr = ddraw_create_swapchain(ddraw, window, !(cooplevel & DDSCL_FULLSCREEN)))) + if (FAILED(hr = ddraw_create_swapchain(ddraw, window, cooplevel))) ERR("Failed to create swapchain, hr %#x.\n", hr);
if (restore_state) diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 137469c..95904ab 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -2638,6 +2638,71 @@ static void test_window_style(void) tmp = GetWindowLongA(window, GWL_EXSTYLE); ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp);
+ hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_NOWINDOWCHANGES); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + todo_wine ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + + hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + ShowWindow(window, SW_HIDE); + tmp = GetWindowLongA(window, GWL_STYLE); + todo_wine ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL | DDSCL_NOWINDOWCHANGES); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + ret = SetForegroundWindow(window); + ok(ret, "Failed to set foreground window.\n"); + + hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + ShowWindow(window, SW_HIDE); + hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ShowWindow(window, SW_SHOW); ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index f3801ef..6092528 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -2716,6 +2716,71 @@ static void test_window_style(void) tmp = GetWindowLongA(window, GWL_EXSTYLE); ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp);
+ hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_NOWINDOWCHANGES); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + todo_wine ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + ShowWindow(window, SW_HIDE); + tmp = GetWindowLongA(window, GWL_STYLE); + todo_wine ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL | DDSCL_NOWINDOWCHANGES); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + ret = SetForegroundWindow(window); + ok(ret, "Failed to set foreground window.\n"); + + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + ShowWindow(window, SW_HIDE); + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ShowWindow(window, SW_SHOW); ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 9c22103..50ea812 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -2952,6 +2952,71 @@ static void test_window_style(void) tmp = GetWindowLongA(window, GWL_EXSTYLE); ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp);
+ hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_NOWINDOWCHANGES); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + todo_wine ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + + hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + ShowWindow(window, SW_HIDE); + tmp = GetWindowLongA(window, GWL_STYLE); + todo_wine ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL | DDSCL_NOWINDOWCHANGES); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + ret = SetForegroundWindow(window); + ok(ret, "Failed to set foreground window.\n"); + + hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + ShowWindow(window, SW_HIDE); + hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ShowWindow(window, SW_SHOW); ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 7cadb88..67f6893 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -2617,6 +2617,71 @@ static void test_window_style(void) tmp = GetWindowLongA(window, GWL_EXSTYLE); ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp);
+ hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_NOWINDOWCHANGES); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + todo_wine ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + + hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + ShowWindow(window, SW_HIDE); + tmp = GetWindowLongA(window, GWL_STYLE); + todo_wine ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL | DDSCL_NOWINDOWCHANGES); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + ret = SetForegroundWindow(window); + ok(ret, "Failed to set foreground window.\n"); + + hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + expected_style = style | WS_VISIBLE; + todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + expected_style = exstyle | WS_EX_TOPMOST; + todo_wine ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp); + + ShowWindow(window, SW_HIDE); + hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); + + tmp = GetWindowLongA(window, GWL_STYLE); + ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); + tmp = GetWindowLongA(window, GWL_EXSTYLE); + todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ShowWindow(window, SW_SHOW); ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n");
Signed-off-by: Stefan Dösinger stefan@codeweavers.com
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=105237
Your paranoid android.
=== w1064v1507 (32 bit report) ===
ddraw: 0bfc:ddraw2: unhandled exception c0000005 at 73CC7F2E
=== w8adm (32 bit report) ===
ddraw: ddraw7.c:18844: Test failed: Got unexpected color 0x0000ff00.
=== w1064v1809 (32 bit report) ===
ddraw: ddraw7.c:18844: Test failed: Got unexpected color 0x00000040.
=== w864 (64 bit report) ===
ddraw: ddraw7.c:3473: Test failed: Failed to create surface, hr 0x887601c2. 0b2c:ddraw7: unhandled exception c0000005 at 00000000005116BF
=== debian11 (32 bit report) ===
ddraw: ddraw4.c:3459: Test failed: Got unexpected screen size 720x480. ddraw4.c:3515: Test failed: Expected screen size 1024x768, got 720x480. ddraw4.c:3521: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3545: Test failed: Expected surface width 1024, got 720. ddraw4.c:3547: Test failed: Expected surface height 768, got 480. ddraw4.c:3551: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3558: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3563: Test failed: Expected surface width 1024, got 720. ddraw4.c:3565: Test failed: Expected surface height 768, got 480. ddraw4.c:3578: Test failed: Expected surface width 1024, got 720. ddraw4.c:3580: Test failed: Expected surface height 768, got 480. ddraw4.c:3584: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3607: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3629: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3634: Test failed: Expected surface width 1024, got 720. ddraw4.c:3636: Test failed: Expected surface height 768, got 480. ddraw4.c:3655: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3675: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3688: Test failed: Expected resolution 1024x768, got 720x480. ddraw4.c:3705: Test failed: Expected surface width 1024, got 720. ddraw4.c:3707: Test failed: Expected surface height 768, got 480. ddraw4.c:3711: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3721: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3726: Test failed: Expected surface width 1024, got 720. ddraw4.c:3728: Test failed: Expected surface height 768, got 480. ddraw4.c:3741: Test failed: Expected surface width 1024, got 720. ddraw4.c:3743: Test failed: Expected surface height 768, got 480. ddraw4.c:3747: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3770: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3792: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3797: Test failed: Expected surface width 1024, got 720. ddraw4.c:3799: Test failed: Expected surface height 768, got 480. ddraw4.c:3818: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3838: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3851: Test failed: Expected resolution 1024x768, got 720x480. ddraw4.c:3868: Test failed: Expected surface width 1024, got 720. ddraw4.c:3870: Test failed: Expected surface height 768, got 480. ddraw4.c:3875: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3894: Test failed: Expected screen size 1024x768, got 720x480. ddraw4.c:3901: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3913: Test failed: Expected surface width 1024, got 720. ddraw4.c:3915: Test failed: Expected surface height 768, got 480. ddraw4.c:3966: Test failed: Expected screen size 2 1024x768, got 720x480. ddraw4.c:3974: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3986: Test failed: Expected surface width 1024, got 720. ddraw4.c:3988: Test failed: Expected surface height 768, got 480.
=== debian11 (32 bit Arabic:Morocco report) ===
ddraw: ddraw1.c:4076: Test failed: Got a different mode.
=== debian11 (32 bit German report) ===
ddraw: ddraw1.c:3881: Test failed: Got unexpected screen width 800. ddraw1.c:3883: Test failed: Got unexpected screen height 600. ddraw2.c:4260: Test failed: Got a different mode. ddraw4.c:5686: Test failed: Display mode not restored after ddraw1::CreateSurface() call ddraw4.c:8484: Test failed: Failed to attach surface, hr 0x8876000a. ddraw4.c:8487: Test failed: Got unexpected hr 0x8876000a. ddraw4.c:8489: Test failed: Failed to detach surface, hr 0x88760014. ddraw4.c:8492: Test failed: Failed to attach surface, hr 0x8876000a. ddraw4.c:8497: Test failed: Failed to detach surface, hr 0x88760014. ddraw7.c:2616: Test failed: Expected window style 0x4cf0000, got 0xa40b0000. ddraw7.c:2649: Test failed: Expected window style 0x4cf0000, got 0xa40b0000. ddraw7.c:2652: Test failed: Expected window extended style 0x108, got 0x8. ddraw7.c:2658: Test failed: Expected window style 0x4cf0000, got 0xa40b0000. ddraw7.c:2661: Test failed: Expected window extended style 0x108, got 0x8. ddraw7.c:2681: Test failed: Expected window style 0x4cf0000, got 0xa40b0000. ddraw7.c:2700: Test failed: Expected (0,0)-(640,480), got (-32000,-32000)-(-31840,-31976). ddraw7.c:2723: Test failed: Expected (0,0)-(640,480), got (-32000,-32000)-(-31840,-31976). ddraw7.c:2743: Test failed: Expected window style 0x4cf0000, got 0xa40b0000. ddraw7.c:3946: Test failed: Got unexpected screen width 800. ddraw7.c:3948: Test failed: Got unexpected screen height 600. ddraw7.c:3953: Test failed: Got unexpected screen width 800. ddraw7.c:3955: Test failed: Got unexpected screen height 600.
=== debian11 (32 bit Hindi:India report) ===
ddraw: ddraw1.c:14366: Test failed: Expected window rect (640,0)-(1664,737), got (0,0)-(1024,737). ddraw1.c:14381: Test failed: Expected window rect (640,0)-(1664,737), got (0,0)-(1024,737).
=== debian11 (32 bit Japanese:Japan report) ===
ddraw: ddraw7.c:3434: Test failed: Expected (0,0)-(640,480), got (0,0)-(1024,768). ddraw7.c:3456: Test failed: Expected (0,0)-(640,480), got (0,0)-(1024,768). ddraw7.c:3482: Test failed: Expected (0,0)-(640,480), got (0,0)-(1024,768). ddraw7.c:3502: Test failed: Expected (0,0)-(640,480), got (0,0)-(1024,768). ddraw7.c:3539: Test failed: Expected (0,0)-(640,480), got (0,0)-(1024,768).
=== debian11 (32 bit Chinese:China report) ===
ddraw: ddraw7.c:3502: Test failed: Expected (0,0)-(640,480), got (0,0)-(1024,768). ddraw7.c:3539: Test failed: Expected (0,0)-(640,480), got (0,0)-(1024,768).
Report validation errors: ddraw7: Timeout
=== debian11 (build log) ===
WineRunWineTest.pl:error: The task timed out
=== debian11 (64 bit WoW report) ===
Report validation errors: ddrawmodes: Timeout
=== debian11 (build log) ===
WineRunWineTest.pl:error: The task timed out
Unless DDSCL_NOWINDOWCHANGES was specified.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
This is ddraw specific, because the flag specified when exiting fullscreen is what matters. wined3d restores from fullscreen when the swapchain is destroyed, in wined3d_swapchain_cleanup, which uses the *original* flags passed when the swapchain was created, so WINED3D_SWAPCHAIN_RESTORE_WINDOW_STATE can't be used; that would affect the restoring behavior at creation, which is not correct for ddraw (but is for dxgi).
I'm not sure how to do this on wined3d side cleanly without passing the flag somehow at swapchain destruction...
dlls/ddraw/ddraw.c | 3 +++ dlls/ddraw/tests/ddraw1.c | 4 ++-- dlls/ddraw/tests/ddraw2.c | 4 ++-- dlls/ddraw/tests/ddraw4.c | 4 ++-- dlls/ddraw/tests/ddraw7.c | 4 ++-- 5 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index ff78dae..8b95860 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -970,6 +970,9 @@ static HRESULT ddraw_set_cooperative_level(struct ddraw *ddraw, HWND window,
if (!(cooplevel & DDSCL_EXCLUSIVE) && (ddraw->cooperative_level & DDSCL_EXCLUSIVE)) { + if (!(cooplevel & DDSCL_NOWINDOWCHANGES)) + SetWindowPos(window, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); + if (restore_mode_on_normal && FAILED(ddraw7_RestoreDisplayMode(&ddraw->IDirectDraw7_iface))) ERR("RestoreDisplayMode failed\n"); ClipCursor(NULL); diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 95904ab..c5afeff 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -2701,7 +2701,7 @@ static void test_window_style(void) tmp = GetWindowLongA(window, GWL_STYLE); ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); - todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp);
ShowWindow(window, SW_SHOW); ret = SetForegroundWindow(GetDesktopWindow()); @@ -2763,7 +2763,7 @@ static void test_window_style(void) tmp = GetWindowLongA(window, GWL_STYLE); ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); - todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp);
ShowWindow(window, SW_SHOW); hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 6092528..f80d4fe 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -2779,7 +2779,7 @@ static void test_window_style(void) tmp = GetWindowLongA(window, GWL_STYLE); ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); - todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp);
ShowWindow(window, SW_SHOW); ret = SetForegroundWindow(GetDesktopWindow()); @@ -2841,7 +2841,7 @@ static void test_window_style(void) tmp = GetWindowLongA(window, GWL_STYLE); ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); - todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp);
ShowWindow(window, SW_SHOW); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 50ea812..4447c56 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -3015,7 +3015,7 @@ static void test_window_style(void) tmp = GetWindowLongA(window, GWL_STYLE); ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); - todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp);
ShowWindow(window, SW_SHOW); ret = SetForegroundWindow(GetDesktopWindow()); @@ -3077,7 +3077,7 @@ static void test_window_style(void) tmp = GetWindowLongA(window, GWL_STYLE); ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); - todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp);
ShowWindow(window, SW_SHOW); hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 67f6893..e5324cf 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -2680,7 +2680,7 @@ static void test_window_style(void) tmp = GetWindowLongA(window, GWL_STYLE); ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); - todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp);
ShowWindow(window, SW_SHOW); ret = SetForegroundWindow(GetDesktopWindow()); @@ -2742,7 +2742,7 @@ static void test_window_style(void) tmp = GetWindowLongA(window, GWL_STYLE); ok(tmp == style, "Expected window style %#x, got %#x.\n", style, tmp); tmp = GetWindowLongA(window, GWL_EXSTYLE); - todo_wine ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp); + ok(tmp == exstyle, "Expected window extended style %#x, got %#x.\n", exstyle, tmp);
ShowWindow(window, SW_SHOW); hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
Am 13.01.2022 um 20:49 schrieb Gabriel Ivăncescu gabrielopcode@gmail.com:
if (!(cooplevel & DDSCL_EXCLUSIVE) && (ddraw->cooperative_level & DDSCL_EXCLUSIVE)) {
if (!(cooplevel & DDSCL_NOWINDOWCHANGES))
SetWindowPos(window, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
if (restore_mode_on_normal && FAILED(ddraw7_RestoreDisplayMode(&ddraw->IDirectDraw7_iface)))
So here comes one more thought: Wouldn't this fit better in the
if ((ddraw->cooperative_level & DDSCL_EXCLUSIVE) && (window != ddraw->dest_window || !(cooplevel & DDSCL_EXCLUSIVE))) wined3d_device_release_focus_window(ddraw->wined3d_device);
Part below?
I am not entirely sure myself, I am trying to trace where exactly the TOPMOST Z order change is done. Maybe it is worth checking what happens on an exclusive -> exclusive switch with different windows. You'd expect the old window to lose topmost and the new one to gain it, but considering how broken ddraw is I wouldn't be surprised if both or neither end up topmost.
On 13/01/2022 21:47, Stefan Dösinger wrote:
Am 13.01.2022 um 20:49 schrieb Gabriel Ivăncescu gabrielopcode@gmail.com:
if (!(cooplevel & DDSCL_EXCLUSIVE) && (ddraw->cooperative_level & DDSCL_EXCLUSIVE)) {
if (!(cooplevel & DDSCL_NOWINDOWCHANGES))
SetWindowPos(window, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
if (restore_mode_on_normal && FAILED(ddraw7_RestoreDisplayMode(&ddraw->IDirectDraw7_iface)))
So here comes one more thought: Wouldn't this fit better in the
if ((ddraw->cooperative_level & DDSCL_EXCLUSIVE) && (window != ddraw->dest_window || !(cooplevel & DDSCL_EXCLUSIVE))) wined3d_device_release_focus_window(ddraw->wined3d_device);
Part below?
I am not entirely sure myself, I am trying to trace where exactly the TOPMOST Z order change is done. Maybe it is worth checking what happens on an exclusive -> exclusive switch with different windows. You'd expect the old window to lose topmost and the new one to gain it, but considering how broken ddraw is I wouldn't be surprised if both or neither end up topmost.
Interesting catch, but I can't seem to test it. Whenever I try to change windows from exclusive I get DDERR_HWNDALREADYSET on native. I tried to look at some place where this is done in current tests and couldn't really find it, which has me wonder how the "window != ddraw->dest_window" was tested / can be reached in the first place?
Am Freitag, 14. Jänner 2022, 17:53:48 EAT schrieben Sie:
Interesting catch, but I can't seem to test it. Whenever I try to change windows from exclusive I get DDERR_HWNDALREADYSET on native. I tried to look at some place where this is done in current tests and couldn't really find it, which has me wonder how the "window != ddraw->dest_window" was tested / can be reached in the first place?
Hmm, reading the tests the switch-between-windows test also switches between exclusive and non-exclusive mode at the same time. (ddraw7.c, 3480, "If the window is changed at the same time, messages are sent to the new window.") . I guess it is an academic difference then.
Am Dienstag, 18. Jänner 2022, 13:10:07 EAT schrieb Stefan Dösinger:
Am Freitag, 14. Jänner 2022, 17:53:48 EAT schrieben Sie:
Interesting catch, but I can't seem to test it. Whenever I try to change windows from exclusive I get DDERR_HWNDALREADYSET on native. I tried to look at some place where this is done in current tests and couldn't really find it, which has me wonder how the "window != ddraw->dest_window" was tested / can be reached in the first place?
Hmm, reading the tests the switch-between-windows test also switches between exclusive and non-exclusive mode at the same time. (ddraw7.c, 3480, "If the window is changed at the same time, messages are sent to the new window.") . I guess it is an academic difference then.
And I have another thought: Maybe add a comment in the code that checking for DDSCL_NOWINDOWCHANGES in cooplevel (new flags) and not ddraw->cooperative_level (old flags) is intentional and not a bug.
On 18/01/2022 12:20, Stefan Dösinger wrote:
Am Dienstag, 18. Jänner 2022, 13:10:07 EAT schrieb Stefan Dösinger:
Am Freitag, 14. Jänner 2022, 17:53:48 EAT schrieben Sie:
Interesting catch, but I can't seem to test it. Whenever I try to change windows from exclusive I get DDERR_HWNDALREADYSET on native. I tried to look at some place where this is done in current tests and couldn't really find it, which has me wonder how the "window != ddraw->dest_window" was tested / can be reached in the first place?
Hmm, reading the tests the switch-between-windows test also switches between exclusive and non-exclusive mode at the same time. (ddraw7.c, 3480, "If the window is changed at the same time, messages are sent to the new window.") . I guess it is an academic difference then.
And I have another thought: Maybe add a comment in the code that checking for DDSCL_NOWINDOWCHANGES in cooplevel (new flags) and not ddraw->cooperative_level (old flags) is intentional and not a bug.
Will do. You're right, it's not very obvious, even from tests (also because most are still todo_wine because of the WS_EX_WINDOW_EDGE thing, unfortunately).
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=105238
Your paranoid android.
=== w8adm (32 bit report) ===
ddraw: ddraw7.c:18844: Test failed: Got unexpected color 0x00000040.
=== w10pro64 (32 bit report) ===
ddraw: ddraw7.c:18844: Test failed: Got unexpected color 0x00000040.
=== w864 (64 bit report) ===
ddraw: ddraw7.c:3473: Test failed: Failed to create surface, hr 0x887601c2. 0b2c:ddraw7: unhandled exception c0000005 at 000000000051150F
=== debian11 (32 bit report) ===
ddraw: ddraw2.c:4153: Test failed: Got a different mode.
=== debian11 (32 bit German report) ===
ddraw: ddraw2.c:4174: Test failed: Got a different mode.
=== debian11 (32 bit French report) ===
ddraw: ddraw2.c:4035: Test failed: Got unexpected screen width 800. ddraw2.c:4037: Test failed: Got unexpected screen height 600. ddraw2.c:4058: Test failed: Got unexpected screen width 800. ddraw2.c:4060: Test failed: Got unexpected screen height 600. ddraw2.c:4065: Test failed: Got unexpected screen width 800. ddraw2.c:4067: Test failed: Got unexpected screen height 600. ddraw4.c:706: Test failed: Got ddraw state 0x887600e1 on message 0x47, expected 0. ddraw4.c:699: Test failed: Got unexpected wparam 1 for message 5, expected 0. ddraw4.c:706: Test failed: Got ddraw state 0x887600e1 on message 0x5, expected 0. ddraw4.c:3452: Test failed: Expected message 0x7e, but didn't receive it. ddraw4.c:3459: Test failed: Got unexpected screen size 720x480. ddraw4.c:3515: Test failed: Expected screen size 1024x768, got 720x480. ddraw4.c:3521: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3545: Test failed: Expected surface width 1024, got 720. ddraw4.c:3547: Test failed: Expected surface height 768, got 480. ddraw4.c:3551: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3558: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3563: Test failed: Expected surface width 1024, got 720. ddraw4.c:3565: Test failed: Expected surface height 768, got 480. ddraw4.c:3578: Test failed: Expected surface width 1024, got 720. ddraw4.c:3580: Test failed: Expected surface height 768, got 480. ddraw4.c:3584: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3607: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3616: Test failed: Got unexpected hr 0. ddraw4.c:3629: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3634: Test failed: Expected surface width 1024, got 720. ddraw4.c:3636: Test failed: Expected surface height 768, got 480. ddraw4.c:3655: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3675: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3721: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480).
=== debian11 (32 bit Hebrew:Israel report) ===
ddraw: ddraw4.c:2951: Test failed: Expected window style 0x4cf0000, got 0xa40b0000. ddraw4.c:2984: Test failed: Expected window style 0x4cf0000, got 0xa40b0000. ddraw4.c:2987: Test failed: Expected window extended style 0x108, got 0x8. ddraw4.c:2993: Test failed: Expected window style 0x4cf0000, got 0xa40b0000. ddraw4.c:2996: Test failed: Expected window extended style 0x108, got 0x8. ddraw4.c:3016: Test failed: Expected window style 0x4cf0000, got 0xa40b0000. ddraw4.c:3018: Test failed: Expected window extended style 0x100, got 0. ddraw4.c:3035: Test failed: Expected (0,0)-(640,480), got (-32000,-32000)-(-31840,-31976). ddraw4.c:3058: Test failed: Expected (0,0)-(640,480), got (-32000,-32000)-(-31840,-31976). ddraw4.c:3078: Test failed: Expected window style 0x4cf0000, got 0xa40b0000. ddraw4.c:3080: Test failed: Expected window extended style 0x100, got 0.
=== debian11 (32 bit Hindi:India report) ===
ddraw: ddraw1.c:14366: Test failed: Expected window rect (640,0)-(1664,737), got (0,0)-(1024,737). ddraw1.c:14381: Test failed: Expected window rect (640,0)-(1664,737), got (0,0)-(1024,737). ddraw4.c:4453: Test failed: Got a different mode.
=== debian11 (32 bit Japanese:Japan report) ===
ddraw: ddraw1.c:868: Test failed: Got unexpected wparam 1 for message 5, expected 0. ddraw1.c:3121: Test failed: Expected message 0x7e, but didn't receive it. ddraw1.c:3126: Test failed: Got unexpected screen size 800x600. ddraw1.c:3182: Test failed: Expected screen size 640x480, got 800x600. ddraw1.c:3188: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw1.c:3212: Test failed: Expected surface width 640, got 800. ddraw1.c:3214: Test failed: Expected surface height 480, got 600. ddraw1.c:3218: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw1.c:3225: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw1.c:3230: Test failed: Expected surface width 640, got 800. ddraw1.c:3232: Test failed: Expected surface height 480, got 600. ddraw1.c:3245: Test failed: Expected surface width 640, got 800. ddraw1.c:3247: Test failed: Expected surface height 480, got 600. ddraw1.c:3251: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw1.c:3274: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw1.c:3303: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw1.c:3308: Test failed: Expected surface width 640, got 800. ddraw1.c:3310: Test failed: Expected surface height 480, got 600. ddraw1.c:3329: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw1.c:3349: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw1.c:3362: Test failed: Expected resolution 640x480, got 800x600. ddraw1.c:3379: Test failed: Expected surface width 640, got 800. ddraw1.c:3381: Test failed: Expected surface height 480, got 600. ddraw1.c:3385: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw1.c:3395: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw1.c:3400: Test failed: Expected surface width 640, got 800. ddraw1.c:3402: Test failed: Expected surface height 480, got 600. ddraw1.c:3415: Test failed: Expected surface width 640, got 800. ddraw1.c:3417: Test failed: Expected surface height 480, got 600. ddraw1.c:3421: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw1.c:3444: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw1.c:3466: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw1.c:3471: Test failed: Expected surface width 640, got 800. ddraw1.c:3473: Test failed: Expected surface height 480, got 600. ddraw1.c:3492: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw1.c:3512: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw1.c:3525: Test failed: Expected resolution 640x480, got 800x600. ddraw1.c:3542: Test failed: Expected surface width 640, got 800. ddraw1.c:3544: Test failed: Expected surface height 480, got 600. ddraw1.c:3549: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600).
=== debian11 (32 bit Chinese:China report) ===
Report validation errors: ddraw4: Timeout
=== debian11 (build log) ===
WineRunWineTest.pl:error: The task timed out
=== debian11 (32 bit WoW report) ===
ddraw: ddraw4.c:3851: Test failed: Expected resolution 1024x768, got 720x480. ddraw4.c:3868: Test failed: Expected surface width 1024, got 720. ddraw4.c:3894: Test failed: Expected screen size 1024x768, got 720x480. ddraw4.c:3901: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3913: Test failed: Expected surface width 1024, got 720. ddraw4.c:3966: Test failed: Expected screen size 2 1024x768, got 720x480. ddraw4.c:3974: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3986: Test failed: Expected surface width 1024, got 720.
=== debian11 (64 bit WoW report) ===
ddraw: ddraw1.c:3303: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw1.c:3329: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw1.c:3349: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw1.c:3385: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480).
Report validation errors: ddraw7: Timeout
=== debian11 (build log) ===
WineRunWineTest.pl:error: The task timed out
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
For some reason I had to use AttachThreadInput, otherwise I couldn't set the window to foreground on Windows, even from the thread itself, it always failed... I don't know why but apparently this is a common "trick" to get around it.
Also, for some reason GetForegroundWindow on wine returns NULL (when it's set to the other thread's window, even if set from the other thread), regardless of AttachThreadInput/SetActiveWindow or not, so I had to mark it as todo_wine. :-/
dlls/d3d8/tests/device.c | 283 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 283 insertions(+)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index fc94dca..d503241 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -3935,16 +3935,50 @@ cleanup: DestroyWindow(hwnd); }
+struct create_window_thread_params +{ + HANDLE event; + HWND hwnd; +}; + +static DWORD WINAPI create_window_thread(void *data) +{ + struct create_window_thread_params *params = data; + HWND hwnd; + MSG msg; + + hwnd = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 10, 20, 30, 40, 0, 0, 0, 0); + ok(!!hwnd, "Failed to create window.\n"); + flush_events(); + params->hwnd = hwnd; + SetEvent(params->event); + while (GetMessageA(&msg, 0, 0, 0)) + { + TranslateMessage(&msg); + DispatchMessageA(&msg); + if (!params->hwnd) + break; + } + DestroyWindow(hwnd); + return 0; +} + static void test_window_style(void) { + struct create_window_thread_params thread_params; RECT focus_rect, fullscreen_rect, r; LONG device_style, device_exstyle; LONG focus_style, focus_exstyle; struct device_desc device_desc; LONG style, expected_style; IDirect3DDevice8 *device; + HWND active_window; IDirect3D8 *d3d8; + DWORD_PTR result; + HANDLE thread; HRESULT hr; + DWORD tid; ULONG ref; BOOL ret;
@@ -4055,6 +4089,255 @@ static void test_window_style(void)
ref = IDirect3DDevice8_Release(device); ok(ref == 0, "The device was not properly freed: refcount %u.\n", ref); + DestroyWindow(device_window); + DestroyWindow(focus_window); + + /* Window changes are done only if the current process has the foreground window at creation */ + focus_window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, registry_mode.dmPelsWidth / 2, registry_mode.dmPelsHeight / 2, 0, 0, 0, 0); + device_window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, registry_mode.dmPelsWidth / 2, registry_mode.dmPelsHeight / 2, 0, 0, 0, 0); + active_window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 10, 20, 30, 40, 0, 0, 0, 0); + + device_style = GetWindowLongA(device_window, GWL_STYLE); + device_exstyle = GetWindowLongA(device_window, GWL_EXSTYLE); + focus_style = GetWindowLongA(focus_window, GWL_STYLE); + focus_exstyle = GetWindowLongA(focus_window, GWL_EXSTYLE); + + ret = SetForegroundWindow(active_window); + ok(ret, "Failed to set foreground window.\n"); + ok(GetActiveWindow() == active_window, "Unexpected active window.\n"); + + device_desc.device_window = device_window; + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + device = create_device(d3d8, focus_window, &device_desc); + ok(!!device, "Failed to create a D3D device.\n"); + + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + expected_style = device_exstyle | WS_EX_TOPMOST; + todo_wine ok(style == expected_style || broken(style == (expected_style & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", expected_style, style); + + style = GetWindowLongA(focus_window, GWL_STYLE); + ok(style == focus_style, "Expected focus window style %#x, got %#x.\n", focus_style, style); + style = GetWindowLongA(focus_window, GWL_EXSTYLE); + ok(style == focus_exstyle, "Expected focus window extended style %#x, got %#x.\n", focus_exstyle, style); + + device_desc.flags = 0; + hr = reset_device(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + + ret = SetForegroundWindow(GetDesktopWindow()); + ok(ret, "Failed to set foreground window.\n"); + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + hr = reset_device(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + ShowWindow(device_window, SW_SHOWNOACTIVATE); + + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + expected_style = device_exstyle | WS_EX_TOPMOST; + todo_wine ok(style == expected_style || broken(style == (expected_style & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", expected_style, style); + GetWindowRect(device_window, &r); + ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); + + ref = IDirect3DDevice8_Release(device); + ok(ref == 0, "The device was not properly freed: refcount %u.\n", ref); + DestroyWindow(active_window); + DestroyWindow(device_window); + DestroyWindow(focus_window); + + focus_window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, registry_mode.dmPelsWidth / 2, registry_mode.dmPelsHeight / 2, 0, 0, 0, 0); + device_window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, registry_mode.dmPelsWidth / 2, registry_mode.dmPelsHeight / 2, 0, 0, 0, 0); + + device_style = GetWindowLongA(device_window, GWL_STYLE); + device_exstyle = GetWindowLongA(device_window, GWL_EXSTYLE); + focus_style = GetWindowLongA(focus_window, GWL_STYLE); + focus_exstyle = GetWindowLongA(focus_window, GWL_EXSTYLE); + + thread_params.hwnd = NULL; + thread_params.event = CreateEventW(NULL, 0, 0, NULL); + ok(!!thread_params.event, "Failed to create event.\n"); + thread = CreateThread(NULL, 0, create_window_thread, &thread_params, 0, &tid); + ok(!!thread, "Failed to create thread.\n"); + ok(WaitForSingleObject(thread_params.event, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed.\n"); + ok(!!thread_params.hwnd, "Failed to create window in another thread.\n"); + CloseHandle(thread_params.event); + + AttachThreadInput(tid, GetCurrentThreadId(), TRUE); + ret = SetForegroundWindow(thread_params.hwnd); + ok(ret, "Failed to set foreground window.\n"); + AttachThreadInput(tid, GetCurrentThreadId(), FALSE); + SendMessageTimeoutW(thread_params.hwnd, WM_NULL, 0, 0, 0, 2000, &result); + + SetActiveWindow(NULL); + todo_wine ok(GetForegroundWindow() == thread_params.hwnd, "Unexpected foreground window.\n"); + + device_desc.device_window = device_window; + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + device = create_device(d3d8, focus_window, &device_desc); + ok(!!device, "Failed to create a D3D device.\n"); + + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + expected_style = device_exstyle | WS_EX_TOPMOST; + todo_wine ok(style == expected_style || broken(style == (expected_style & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", expected_style, style); + + style = GetWindowLongA(focus_window, GWL_STYLE); + ok(style == focus_style, "Expected focus window style %#x, got %#x.\n", focus_style, style); + style = GetWindowLongA(focus_window, GWL_EXSTYLE); + ok(style == focus_exstyle, "Expected focus window extended style %#x, got %#x.\n", focus_exstyle, style); + + ref = IDirect3DDevice8_Release(device); + ok(ref == 0, "The device was not properly freed: refcount %u.\n", ref); + thread_params.hwnd = NULL; + PostThreadMessageW(tid, WM_NULL, 0, 0); + DestroyWindow(device_window); + DestroyWindow(focus_window); + ok(WaitForSingleObject(thread, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed.\n"); + CloseHandle(thread); + + focus_window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, registry_mode.dmPelsWidth / 2, registry_mode.dmPelsHeight / 2, 0, 0, 0, 0); + device_window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, registry_mode.dmPelsWidth / 2, registry_mode.dmPelsHeight / 2, 0, 0, 0, 0); + + device_style = GetWindowLongA(device_window, GWL_STYLE); + device_exstyle = GetWindowLongA(device_window, GWL_EXSTYLE); + focus_style = GetWindowLongA(focus_window, GWL_STYLE); + focus_exstyle = GetWindowLongA(focus_window, GWL_EXSTYLE); + + ret = SetForegroundWindow(GetDesktopWindow()); + ok(ret, "Failed to set foreground window.\n"); + SetActiveWindow(focus_window); + ok(GetActiveWindow() == focus_window, "Unexpected active window.\n"); + + device_desc.device_window = device_window; + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + device = create_device(d3d8, focus_window, &device_desc); + ok(!!device, "Failed to create a D3D device.\n"); + ShowWindow(device_window, SW_SHOWNOACTIVATE); + + /* Windows 8 and some versions of Windows 10 have some pretty + inconsistent behavior but topmost is set even when inactive. */ + style = GetWindowLongA(device_window, GWL_EXSTYLE); + if (broken(style & WS_EX_TOPMOST)) + { + win_skip("topmost set when inactive due to inconsistent behavior, skipping related tests...\n"); + goto skip_inactive; + } + todo_wine ok(style == device_exstyle || broken(style == (device_exstyle & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", device_exstyle, style); + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + + style = GetWindowLongA(focus_window, GWL_STYLE); + ok(style == focus_style, "Expected focus window style %#x, got %#x.\n", focus_style, style); + style = GetWindowLongA(focus_window, GWL_EXSTYLE); + ok(style == focus_exstyle, "Expected focus window extended style %#x, got %#x.\n", focus_exstyle, style); + + device_desc.flags = 0; + hr = reset_device(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + + ret = SetForegroundWindow(GetDesktopWindow()); + ok(ret, "Failed to set foreground window.\n"); + SetActiveWindow(focus_window); + ok(GetActiveWindow() == focus_window, "Unexpected active window."); + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + hr = reset_device(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + todo_wine ok(style == device_exstyle || broken(style == (device_exstyle & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", device_exstyle, style); + GetWindowRect(device_window, &r); + ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); + + SetForegroundWindow(focus_window); + ok(ret, "Failed to set foreground window.\n"); + hr = reset_device(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + todo_wine ok(style == device_exstyle || broken(style == (device_exstyle & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", device_exstyle, style); + + device_desc.flags = 0; + hr = reset_device(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + hr = reset_device(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + todo_wine ok(style == device_exstyle || broken(style == (device_exstyle & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", device_exstyle, style); + + ref = IDirect3DDevice8_Release(device); + ok(ref == 0, "The device was not properly freed: refcount %u.\n", ref); + DestroyWindow(device_window); + DestroyWindow(focus_window); + + focus_window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, registry_mode.dmPelsWidth / 2, registry_mode.dmPelsHeight / 2, 0, 0, 0, 0); + device_window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, registry_mode.dmPelsWidth / 2, registry_mode.dmPelsHeight / 2, 0, 0, 0, 0); + + device_style = GetWindowLongA(device_window, GWL_STYLE); + device_exstyle = GetWindowLongA(device_window, GWL_EXSTYLE); + focus_style = GetWindowLongA(focus_window, GWL_STYLE); + focus_exstyle = GetWindowLongA(focus_window, GWL_EXSTYLE); + + ret = SetForegroundWindow(GetDesktopWindow()); + ok(ret, "Failed to set foreground window.\n"); + SetActiveWindow(device_window); + ok(GetActiveWindow() == device_window, "Unexpected active window.\n"); + + device_desc.device_window = device_window; + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + device = create_device(d3d8, focus_window, &device_desc); + ok(!!device, "Failed to create a D3D device.\n"); + ShowWindow(device_window, SW_SHOWNOACTIVATE); + + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + todo_wine ok(style == device_exstyle || broken(style == (device_exstyle & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", device_exstyle, style); + + style = GetWindowLongA(focus_window, GWL_STYLE); + ok(style == focus_style, "Expected focus window style %#x, got %#x.\n", focus_style, style); + style = GetWindowLongA(focus_window, GWL_EXSTYLE); + ok(style == focus_exstyle, "Expected focus window extended style %#x, got %#x.\n", focus_exstyle, style); + +skip_inactive: + ref = IDirect3DDevice8_Release(device); + ok(ref == 0, "The device was not properly freed: refcount %u.\n", ref);
done: IDirect3D8_Release(d3d8);
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=105239
Your paranoid android.
=== w8adm (32 bit report) ===
d3d8: device.c:5014: Test failed: Failed to reset device. device.c:5020: Test failed: Expected (0,0)-(1024,768), got (0,0)-(512,384). device.c:5027: Test failed: Expected wndproc != 0x422e00. device.c:11017: Test failed: Adapter 0: SetForegroundWindow failed, error 0.
=== w1064v1507 (32 bit report) ===
d3d8: device.c:11017: Test failed: Adapter 0: SetForegroundWindow failed, error 0.
=== w1064v1809 (32 bit report) ===
d3d8: device.c:11017: Test failed: Adapter 0: SetForegroundWindow failed, error 0.
=== w10pro64 (32 bit report) ===
d3d8: device.c:11017: Test failed: Adapter 0: SetForegroundWindow failed, error 0.
=== debian11 (32 bit Arabic:Morocco report) ===
d3d8: device.c:4612: Test failed: Expected resolution 1024x768, got 720x480. device.c:4642: Test failed: Expected resolution 1024x768, got 720x480.
=== debian11 (32 bit French report) ===
d3d8: device.c:3175: Test failed: Expected message 0x3 for window 0, but didn't receive it, i=2. device.c:3337: Test failed: Expected message 0x1c for window 0x1, but didn't receive it device.c:10991: Test failed: Adapter 0: Expect window rect (0,0)-(640,480), got (4,14)-(644,494). device.c:11021: Test failed: Adapter 1: Expect window rect (640,0)-(1664,737), got (0,0)-(1024,737).
=== debian11 (32 bit Hebrew:Israel report) ===
d3d8: device.c:3175: Test failed: Expected message 0x1c for window 0x1, but didn't receive it, i=2. device.c:10991: Test failed: Adapter 0: Expect window rect (0,0)-(640,480), got (4,14)-(644,494).
=== debian11 (32 bit Hindi:India report) ===
d3d8: device.c:3175: Test failed: Expected message 0x1c for window 0x1, but didn't receive it, i=2. device.c:11021: Test failed: Adapter 1: Expect window rect (640,0)-(1664,737), got (0,0)-(1024,737).
=== debian11 (32 bit Japanese:Japan report) ===
d3d8: device.c:3175: Test failed: Expected message 0x1c for window 0x1, but didn't receive it, i=2.
=== debian11 (32 bit Chinese:China report) ===
d3d8: device.c:3175: Test failed: Expected message 0x3 for window 0, but didn't receive it, i=2. device.c:3337: Test failed: Expected message 0x1c for window 0x1, but didn't receive it device.c:10991: Test failed: Adapter 0: Expect window rect (0,0)-(640,480), got (4,15)-(644,495). device.c:10991: Test failed: Adapter 1: Expect window rect (640,0)-(1664,737), got (640,0)-(1280,480). device.c:11021: Test failed: Adapter 1: Expect window rect (640,0)-(1664,737), got (0,0)-(1024,737).
Am Donnerstag, 13. Jänner 2022, 20:49:43 EAT schrieb Gabriel Ivăncescu:
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com
For some reason I had to use AttachThreadInput, otherwise I couldn't set the window to foreground on Windows, even from the thread itself, it always failed... I don't know why but apparently this is a common "trick" to get around it.
I vaguely remember that I had some luck with minimizing and restoring the window, see test_wndproc() in d3d9/tests/device.c:
/* I have to minimize and restore the focus window, otherwise native d3d9 fails * device::reset with D3DERR_DEVICELOST. This does not happen when the window * restore is triggered by the user. */ expect_messages = tests[i].reactivate_messages; ShowWindow(focus_window, SW_MINIMIZE); ShowWindow(focus_window, SW_RESTORE); /* Set focus twice to make KDE and fvwm in focus-follows-mouse mode happy. */ SetForegroundWindow(focus_window); flush_events(); SetForegroundWindow(focus_window); flush_events(); /* WM_WINDOWPOSCHANGING etc arrive after SetForegroundWindow returns. */
Note that some of the quirks in that test are to make weird Linux WMs happy, but some are to make Windows do what we want.
Attaching the thread input might have unintended side effects, like both threads being considered foreground or so. Not sure though.
---
So let me recap the ddraw, d3d8, d3d9, dxgi tests for my understanding:
ddraw: The ddraw window itself needs to be foreground, otherwise it is not made topmost
d3d8: Any process window needs to be foreground for the device window to be made topmost
d3d9: The device window is made topmost, no matter what d3d9ex: The focus window needs to be foreground
dxgi: like plain d3d9, the window is made foreground no matter what.
What a mess...
On 18/01/2022 13:03, Stefan Dösinger wrote:
Am Donnerstag, 13. Jänner 2022, 20:49:43 EAT schrieb Gabriel Ivăncescu:
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com
For some reason I had to use AttachThreadInput, otherwise I couldn't set the window to foreground on Windows, even from the thread itself, it always failed... I don't know why but apparently this is a common "trick" to get around it.
I vaguely remember that I had some luck with minimizing and restoring the window, see test_wndproc() in d3d9/tests/device.c:
/* I have to minimize and restore the focus window, otherwise native
d3d9 fails * device::reset with D3DERR_DEVICELOST. This does not happen when the window * restore is triggered by the user. */ expect_messages = tests[i].reactivate_messages; ShowWindow(focus_window, SW_MINIMIZE); ShowWindow(focus_window, SW_RESTORE); /* Set focus twice to make KDE and fvwm in focus-follows-mouse mode happy. */ SetForegroundWindow(focus_window); flush_events(); SetForegroundWindow(focus_window); flush_events(); /* WM_WINDOWPOSCHANGING etc arrive after SetForegroundWindow returns. */
Note that some of the quirks in that test are to make weird Linux WMs happy, but some are to make Windows do what we want.
Attaching the thread input might have unintended side effects, like both threads being considered foreground or so. Not sure though.
Thanks for the tip, I'll try something with it then.
So let me recap the ddraw, d3d8, d3d9, dxgi tests for my understanding:
ddraw: The ddraw window itself needs to be foreground, otherwise it is not made topmost
d3d8: Any process window needs to be foreground for the device window to be made topmost
d3d9: The device window is made topmost, no matter what d3d9ex: The focus window needs to be foreground
dxgi: like plain d3d9, the window is made foreground no matter what.
What a mess...
Yep. There's also visibility affecting d3d8 and d3d9ex (i.e. hidden focus windows always do changes, even if the foreground condition does not apply). This doesn't apply to ddraw, so it was worth mentioning, although we *do* have existing tests for this, because most of the prior tests are done on hidden windows, so they're implicitly tested already.
This is also the reason for the ddraw regression; since at that point we only had tests on hidden windows, it was implicitly always treated as "not foreground" (because ddraw doesn't special case hidden windows), and so unconditionally applied the NOWINDOWCHANGES flag.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/d3d9/tests/d3d9ex.c | 210 +++++++++++++++++++++++++++++++++++++++ dlls/d3d9/tests/device.c | 57 ++++++++++- 2 files changed, 264 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c index 2afe730..84298c6 100644 --- a/dlls/d3d9/tests/d3d9ex.c +++ b/dlls/d3d9/tests/d3d9ex.c @@ -3475,6 +3475,7 @@ static void test_window_style(void) struct device_desc device_desc; LONG style; IDirect3DDevice9Ex *device; + HWND active_window; HRESULT hr; ULONG ref; BOOL ret; @@ -3662,6 +3663,215 @@ static void test_window_style(void) DestroyWindow(device_window); DestroyWindow(focus_window); } + + /* Window changes are done only if the focus window is foreground */ + focus_window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, registry_mode.dmPelsWidth / 2, registry_mode.dmPelsHeight / 2, 0, 0, 0, 0); + device_window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, registry_mode.dmPelsWidth / 2, registry_mode.dmPelsHeight / 2, 0, 0, 0, 0); + active_window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 10, 20, 30, 40, 0, 0, 0, 0); + + device_style = GetWindowLongA(device_window, GWL_STYLE); + device_exstyle = GetWindowLongA(device_window, GWL_EXSTYLE); + focus_style = GetWindowLongA(focus_window, GWL_STYLE); + focus_exstyle = GetWindowLongA(focus_window, GWL_EXSTYLE); + + ret = SetForegroundWindow(active_window); + ok(ret, "Failed to set foreground window.\n"); + ok(GetActiveWindow() == active_window, "Unexpected active window.\n"); + + device_desc.device_window = device_window; + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + device = create_device(focus_window, &device_desc); + ok(!!device, "Failed to create a D3D device.\n"); + ref = IDirect3DDevice9Ex_Release(device); + ok(ref == 0, "The device was not properly freed: refcount %u.\n", ref); + + ret = SetForegroundWindow(active_window); + ok(ret, "Failed to set foreground window.\n"); + ok(GetActiveWindow() == active_window, "Unexpected active window.\n"); + + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + device = create_device(focus_window, &device_desc); + ok(!!device, "Failed to create a D3D device.\n"); + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + todo_wine ok(style == device_exstyle || broken(style == (device_exstyle & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", device_exstyle, style); + + style = GetWindowLongA(focus_window, GWL_STYLE); + ok(style == focus_style, "Expected focus window style %#x, got %#x.\n", focus_style, style); + style = GetWindowLongA(focus_window, GWL_EXSTYLE); + ok(style == focus_exstyle, "Expected focus window extended style %#x, got %#x.\n", focus_exstyle, style); + GetWindowRect(device_window, &r); + ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); + + device_desc.flags = 0; + hr = reset_device(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + todo_wine ok(style == device_exstyle || broken(style == (device_exstyle & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", device_exstyle, style); + + ret = SetForegroundWindow(GetDesktopWindow()); + ok(ret, "Failed to set foreground window.\n"); + SetActiveWindow(active_window); + ok(GetActiveWindow() == active_window, "Unexpected active window.\n"); + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + hr = reset_device(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + todo_wine ok(style == device_exstyle || broken(style == (device_exstyle & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", device_exstyle, style); + + SetForegroundWindow(focus_window); + ok(ret, "Failed to set foreground window.\n"); + hr = reset_device(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + expected_style = device_exstyle | WS_EX_TOPMOST; + todo_wine ok(style == expected_style || broken(style == (expected_style & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", expected_style, style); + + device_desc.flags = 0; + hr = reset_device(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + expected_style = device_exstyle | WS_EX_TOPMOST; + todo_wine ok(style == expected_style || broken(style == (expected_style & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", expected_style, style); + + ref = IDirect3DDevice9Ex_Release(device); + ok(ref == 0, "The device was not properly freed: refcount %u.\n", ref); + + DestroyWindow(active_window); + DestroyWindow(device_window); + DestroyWindow(focus_window); + + focus_window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, registry_mode.dmPelsWidth / 2, registry_mode.dmPelsHeight / 2, 0, 0, 0, 0); + device_window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, registry_mode.dmPelsWidth / 2, registry_mode.dmPelsHeight / 2, 0, 0, 0, 0); + + device_style = GetWindowLongA(device_window, GWL_STYLE); + device_exstyle = GetWindowLongA(device_window, GWL_EXSTYLE); + focus_style = GetWindowLongA(focus_window, GWL_STYLE); + focus_exstyle = GetWindowLongA(focus_window, GWL_EXSTYLE); + + ret = SetForegroundWindow(GetDesktopWindow()); + ok(ret, "Failed to set foreground window.\n"); + SetActiveWindow(focus_window); + ok(GetActiveWindow() == focus_window, "Unexpected active window.\n"); + + device_desc.device_window = device_window; + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + device = create_device(focus_window, &device_desc); + ok(!!device, "Failed to create a D3D device.\n"); + ref = IDirect3DDevice9Ex_Release(device); + ok(ref == 0, "The device was not properly freed: refcount %u.\n", ref); + + ret = SetForegroundWindow(GetDesktopWindow()); + ok(ret, "Failed to set foreground window.\n"); + SetActiveWindow(focus_window); + ok(GetActiveWindow() == focus_window, "Unexpected active window.\n"); + + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + device = create_device(focus_window, &device_desc); + ok(!!device, "Failed to create a D3D device.\n"); + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + todo_wine ok(style == device_exstyle || broken(style == (device_exstyle & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", device_exstyle, style); + + style = GetWindowLongA(focus_window, GWL_STYLE); + ok(style == focus_style, "Expected focus window style %#x, got %#x.\n", focus_style, style); + style = GetWindowLongA(focus_window, GWL_EXSTYLE); + ok(style == focus_exstyle, "Expected focus window extended style %#x, got %#x.\n", focus_exstyle, style); + GetWindowRect(device_window, &r); + ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); + + device_desc.flags = 0; + hr = reset_device(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + + ret = SetForegroundWindow(GetDesktopWindow()); + ok(ret, "Failed to set foreground window.\n"); + SetActiveWindow(focus_window); + ok(GetActiveWindow() == focus_window, "Unexpected active window.\n"); + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + hr = reset_device(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + todo_wine ok(style == device_exstyle || broken(style == (device_exstyle & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", device_exstyle, style); + + SetForegroundWindow(device_window); + ok(ret, "Failed to set foreground window.\n"); + hr = reset_device(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + todo_wine ok(style == device_exstyle || broken(style == (device_exstyle & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", device_exstyle, style); + + SetForegroundWindow(focus_window); + ok(ret, "Failed to set foreground window.\n"); + hr = reset_device(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + expected_style = device_exstyle | WS_EX_TOPMOST; + todo_wine ok(style == expected_style || broken(style == (expected_style & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", expected_style, style); + + device_desc.flags = 0; + hr = reset_device(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + expected_style = device_exstyle | WS_EX_TOPMOST; + todo_wine ok(style == expected_style || broken(style == (expected_style & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", expected_style, style); + + ref = IDirect3DDevice9Ex_Release(device); + ok(ref == 0, "The device was not properly freed: refcount %u.\n", ref); + + DestroyWindow(device_window); + DestroyWindow(focus_window); }
static void test_swapchain_parameters(void) diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index c480a9d..b922c88 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -5051,9 +5051,7 @@ static void test_window_style(void) if (!(device = create_device(d3d9, focus_window, &device_desc))) { skip("Failed to create a D3D device, skipping tests.\n"); - DestroyWindow(device_window); - DestroyWindow(focus_window); - break; + goto done; }
style = GetWindowLongA(device_window, GWL_STYLE); @@ -5148,6 +5146,59 @@ static void test_window_style(void) DestroyWindow(device_window); DestroyWindow(focus_window); } + + /* Window changes are always done no matter if it is active or not */ + focus_window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, registry_mode.dmPelsWidth / 2, registry_mode.dmPelsHeight / 2, 0, 0, 0, 0); + device_window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, registry_mode.dmPelsWidth / 2, registry_mode.dmPelsHeight / 2, 0, 0, 0, 0); + + device_style = GetWindowLongA(device_window, GWL_STYLE); + device_exstyle = GetWindowLongA(device_window, GWL_EXSTYLE); + focus_style = GetWindowLongA(focus_window, GWL_STYLE); + focus_exstyle = GetWindowLongA(focus_window, GWL_EXSTYLE); + + ret = SetForegroundWindow(GetDesktopWindow()); + ok(ret, "Failed to set foreground window.\n"); + + device_desc.device_window = device_window; + device_desc.flags = CREATE_DEVICE_FULLSCREEN; + device = create_device(d3d9, focus_window, &device_desc); + ok(!!device, "Failed to create a D3D device.\n"); + + style = GetWindowLongA(device_window, GWL_STYLE); + todo_wine ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + expected_style = device_exstyle | WS_EX_TOPMOST; + todo_wine ok(style == expected_style || broken(style == (expected_style & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", expected_style, style); + + style = GetWindowLongA(focus_window, GWL_STYLE); + ok(style == focus_style, "Expected focus window style %#x, got %#x.\n", focus_style, style); + style = GetWindowLongA(focus_window, GWL_EXSTYLE); + ok(style == focus_exstyle, "Expected focus window extended style %#x, got %#x.\n", focus_exstyle, style); + GetWindowRect(device_window, &r); + ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); + + device_desc.flags = 0; + hr = reset_device(device, &device_desc); + ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); + + style = GetWindowLongA(device_window, GWL_STYLE); + ok(style == device_style || broken(style == (device_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window style %#x, got %#x.\n", device_style, style); + style = GetWindowLongA(device_window, GWL_EXSTYLE); + expected_style = device_exstyle | WS_EX_TOPMOST; + ok(style == expected_style || broken(style == (expected_style & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + "Expected device window extended style %#x, got %#x.\n", expected_style, style); + + ref = IDirect3DDevice9_Release(device); + ok(ref == 0, "The device was not properly freed: refcount %u.\n", ref); + +done: + DestroyWindow(device_window); + DestroyWindow(focus_window); IDirect3D9_Release(d3d9); }
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=105240
Your paranoid android.
=== w1064v1507 (64 bit report) ===
d3d9: device.c:2448: Test failed: IDirect3DDevice9_Reset failed with 88760873 device.c:2450: Test failed: IDirect3DDevice9_TestCooperativeLevel after a successful reset returned 0x88760869 device.c:2455: Test failed: IDirect3DDevice9_CreateTexture returned 8876086c 0880:device: unhandled exception c0000005 at 000000000044CD71
=== debian11 (32 bit French report) ===
d3d9: d3d9ex.c:3132: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0.
=== debian11 (32 bit Hebrew:Israel report) ===
d3d9: device.c:14662: Test failed: Adapter 1: Expect window rect (640,0)-(1664,737), got (640,0)-(1280,480).
=== debian11 (32 bit Hindi:India report) ===
d3d9: d3d9ex.c:1110: Test failed: Got screen width 720, expected 640. d3d9ex.c:1689: Test failed: Got screen width 720, expected 640. d3d9ex.c:2986: Test failed: Got unexpected screen size 720x480. d3d9ex.c:3040: Test failed: Got unexpected width 720. d3d9ex.c:3151: Test failed: Expected message 0x3 for window 0x1, but didn't receive it, i=0. d3d9ex.c:2986: Test failed: Got unexpected screen size 720x480. d3d9ex.c:3040: Test failed: Got unexpected width 720. device.c:4341: Test failed: Expected message 0x7e for window 0x1, but didn't receive it, i=1. device.c:5467: Test failed: Expected resolution 720x480, got 640x480. device.c:5497: Test failed: Expected resolution 720x480, got 640x480. device.c:14662: Test failed: Adapter 0: Expect window rect (0,0)-(640,480), got (0,0)-(1024,768).
=== debian11 (32 bit Chinese:China report) ===
d3d9: d3d9ex.c:3132: Test failed: Expected message 0x46 for window 0x1, but didn't receive it, i=0.
=== debian11 (64 bit WoW report) ===
d3d9: d3d9ex.c:2986: Test failed: Got unexpected screen size 640x480. d3d9ex.c:3040: Test failed: Got unexpected width 640. d3d9ex.c:3041: Test failed: Got unexpected height 480. d3d9ex.c:3151: Test failed: Expected message 0x3 for window 0x1, but didn't receive it, i=0. d3d9ex.c:2986: Test failed: Got unexpected screen size 640x480. d3d9ex.c:3040: Test failed: Got unexpected width 640. d3d9ex.c:3041: Test failed: Got unexpected height 480. device.c:4223: Test failed: Expected message 0x46 for window 0, but didn't receive it, i=0. device.c:14728: Test failed: Adapter 1: Expect window rect (640,0)-(1664,737), got (0,0)-(1024,737).
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/dxgi/tests/dxgi.c | 46 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-)
diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c index a83964d..a7d36ac 100644 --- a/dlls/dxgi/tests/dxgi.c +++ b/dlls/dxgi/tests/dxgi.c @@ -6049,7 +6049,7 @@ done:
static void test_swapchain_window_styles(void) { - LONG style, exstyle, fullscreen_style, fullscreen_exstyle; + LONG style, exstyle, fullscreen_style, fullscreen_exstyle, expected_style; DXGI_SWAP_CHAIN_DESC swapchain_desc; IDXGISwapChain *swapchain; IDXGIFactory *factory; @@ -6058,6 +6058,7 @@ static void test_swapchain_window_styles(void) ULONG refcount; unsigned int i; HRESULT hr; + BOOL ret;
static const struct { @@ -6225,6 +6226,49 @@ static void test_swapchain_window_styles(void) DestroyWindow(swapchain_desc.OutputWindow); }
+ /* Window changes are always done no matter if it is active or not */ + swapchain_desc.OutputWindow = CreateWindowExA(0, "static", "dxgi_test", + WS_OVERLAPPED | WS_VISIBLE, 0, 0, 400, 200, 0, 0, 0, 0); + + expected_style = WS_OVERLAPPED | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CAPTION; + fullscreen_style = WS_VISIBLE | WS_CLIPSIBLINGS; + + ret = SetForegroundWindow(GetDesktopWindow()); + ok(ret, "Failed to set foreground window.\n"); + hr = IDXGIFactory_CreateSwapChain(factory, (IUnknown *)device, &swapchain_desc, &swapchain); + ok(hr == S_OK, "Failed to create swapchain, hr %#x.\n", hr); + + style = GetWindowLongA(swapchain_desc.OutputWindow, GWL_STYLE); + exstyle = GetWindowLongA(swapchain_desc.OutputWindow, GWL_EXSTYLE); + ok(style == expected_style, "Got style %#x, expected %#x.\n", style, expected_style); + ok(exstyle == WS_EX_WINDOWEDGE, "Got exstyle %#x, expected %#x.\n", exstyle, (DWORD)WS_EX_WINDOWEDGE); + + ret = SetForegroundWindow(GetDesktopWindow()); + ok(ret, "Failed to set foreground window.\n"); + hr = IDXGISwapChain_SetFullscreenState(swapchain, TRUE, NULL); + ok(hr == S_OK || hr == DXGI_ERROR_NOT_CURRENTLY_AVAILABLE + || broken(hr == DXGI_ERROR_UNSUPPORTED), /* Win 7 testbot */ + "Failed to set fullscreen state, hr %#x.\n", hr); + if (SUCCEEDED(hr)) + { + style = GetWindowLongA(swapchain_desc.OutputWindow, GWL_STYLE); + exstyle = GetWindowLongA(swapchain_desc.OutputWindow, GWL_EXSTYLE); + todo_wine + ok(style == fullscreen_style, "Got style %#x, expected %#x.\n", style, fullscreen_style); + ok(exstyle == WS_EX_TOPMOST, "Got exstyle %#x, expected %#x.\n", exstyle, (DWORD)WS_EX_TOPMOST); + + hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + } + else + { + skip("Could not change fullscreen state %08x.\n", hr); + } + + refcount = IDXGISwapChain_Release(swapchain); + ok(!refcount, "IDXGISwapChain has %u references left.\n", refcount); + DestroyWindow(swapchain_desc.OutputWindow); + refcount = IDXGIDevice_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); refcount = IDXGIFactory_Release(factory);
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=105241
Your paranoid android.
=== w1064_2qxl (64 bit report) ===
dxgi: dxgi.c:2836: Test failed: Got unexpected hr 0x887a0022. dxgi.c:2839: Test failed: Got unexpected fullscreen 0. dxgi.c:2842: Test failed: Got unexpected hr 0x887a0022. dxgi.c:2845: Test failed: Got unexpected fullscreen 0.
=== debian11 (32 bit Arabic:Morocco report) ===
dxgi: dxgi.c:2196: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(800,600). dxgi.c:2209: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(800,600). dxgi.c:3699: Test failed: Got monitor rect (0,0)-(800,600), expected (0,0)-(640,480). dxgi.c:3644: Test failed: Got monitor rect (0,0)-(800,600), expected (0,0)-(640,480). dxgi.c:3670: Test failed: Got monitor rect (0,0)-(800,600), expected (0,0)-(640,480). dxgi.c:3699: Test failed: Got monitor rect (0,0)-(800,600), expected (0,0)-(640,480). dxgi.c:3644: Test failed: Got monitor rect (0,0)-(800,600), expected (0,0)-(640,480). dxgi.c:3670: Test failed: Got monitor rect (0,0)-(800,600), expected (0,0)-(640,480). dxgi.c:3699: Test failed: Got monitor rect (0,0)-(800,600), expected (0,0)-(640,480).
=== debian11 (32 bit German report) ===
dxgi: dxgi.c:3644: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(800,600). dxgi.c:3670: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(800,600). dxgi.c:3699: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(800,600). dxgi.c:3644: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(800,600). dxgi.c:3670: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(800,600). dxgi.c:3699: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(800,600). dxgi.c:3644: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(800,600). dxgi.c:3670: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(800,600). dxgi.c:3699: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(800,600). dxgi.c:3354: Test failed: Got monitor rect (0,0)-(1152,768), expected (0,0)-(640,480). dxgi.c:3356: Test failed: Got monitor rect (0,0)-(1152,768), expected (0,0)-(640,480). dxgi.c:3369: Test failed: Got monitor rect (0,0)-(1152,768), expected (0,0)-(640,480).
=== debian11 (32 bit Hebrew:Israel report) ===
dxgi: dxgi.c:3354: Test failed: Got monitor rect (0,0)-(1280,854), expected (0,0)-(1152,768). dxgi.c:3356: Test failed: Got monitor rect (0,0)-(1280,854), expected (0,0)-(1152,768). dxgi.c:3369: Test failed: Got monitor rect (0,0)-(1280,854), expected (0,0)-(1152,768).
=== debian11 (32 bit Japanese:Japan report) ===
dxgi: dxgi.c:3354: Test failed: Got monitor rect (0,0)-(1280,800), expected (0,0)-(1280,854). dxgi.c:3356: Test failed: Got monitor rect (0,0)-(1280,800), expected (0,0)-(1280,854). dxgi.c:3369: Test failed: Got monitor rect (0,0)-(1280,800), expected (0,0)-(1280,854).
=== debian11 (32 bit Chinese:China report) ===
dxgi: dxgi.c:3699: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(1280,800). dxgi.c:3644: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(1280,800). dxgi.c:3670: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(1280,800). dxgi.c:3699: Test failed: Got monitor rect (0,0)-(640,480), expected (0,0)-(1280,800).
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=105236
Your paranoid android.
=== w1064v1809 (32 bit report) ===
ddraw: ddraw1.c:11848: Test failed: Got unexpected color 0x00ffffff.
=== w1064v1809 (32 bit report) ===
ddraw: ddraw7.c:18779: Test failed: Got unexpected color 0x00000040.
=== w1064 (32 bit report) ===
ddraw: ddraw7.c:18779: Test failed: Got unexpected color 0x00000040.
=== debian11 (32 bit report) ===
ddraw: ddraw1.c:3297: Test failed: Expected resolution 1024x768, got 720x480. ddraw1.c:3314: Test failed: Expected surface width 1024, got 720. ddraw1.c:3316: Test failed: Expected surface height 768, got 480. ddraw1.c:3330: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw1.c:3335: Test failed: Expected surface width 1024, got 720. ddraw1.c:3337: Test failed: Expected surface height 768, got 480. ddraw1.c:3350: Test failed: Expected surface width 1024, got 720. ddraw1.c:3352: Test failed: Expected surface height 768, got 480. ddraw1.c:3356: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw1.c:3379: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw1.c:3401: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw1.c:3406: Test failed: Expected surface width 1024, got 720. ddraw1.c:3408: Test failed: Expected surface height 768, got 480. ddraw1.c:3427: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw1.c:3447: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw1.c:3460: Test failed: Expected resolution 1024x768, got 720x480. ddraw1.c:3477: Test failed: Expected surface width 1024, got 720. ddraw1.c:3479: Test failed: Expected surface height 768, got 480. ddraw1.c:3484: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw2.c:3848: Test failed: Got unexpected screen width 800. ddraw2.c:3850: Test failed: Got unexpected screen height 600. ddraw2.c:3873: Test failed: Got unexpected screen width 800. ddraw2.c:3875: Test failed: Got unexpected screen height 600. ddraw2.c:3880: Test failed: Got unexpected screen width 800. ddraw2.c:3882: Test failed: Got unexpected screen height 600. ddraw2.c:3904: Test failed: Got unexpected screen width 800. ddraw2.c:3906: Test failed: Got unexpected screen height 600. ddraw2.c:3911: Test failed: Got unexpected screen width 800. ddraw2.c:3913: Test failed: Got unexpected screen height 600. ddraw2.c:3935: Test failed: Got unexpected screen width 800. ddraw2.c:3937: Test failed: Got unexpected screen height 600. ddraw2.c:3970: Test failed: Got unexpected screen width 800. ddraw2.c:3972: Test failed: Got unexpected screen height 600. ddraw2.c:3993: Test failed: Got unexpected screen width 800. ddraw2.c:3995: Test failed: Got unexpected screen height 600. ddraw2.c:4000: Test failed: Got unexpected screen width 800. ddraw2.c:4002: Test failed: Got unexpected screen height 600. ddraw4.c:4159: Test failed: Got unexpected screen width 640. ddraw4.c:4161: Test failed: Got unexpected screen height 480. ddraw4.c:4194: Test failed: Got unexpected screen width 640. ddraw4.c:4196: Test failed: Got unexpected screen height 480. ddraw4.c:4217: Test failed: Got unexpected screen width 640. ddraw4.c:4219: Test failed: Got unexpected screen height 480. ddraw4.c:4224: Test failed: Got unexpected screen width 640. ddraw4.c:4226: Test failed: Got unexpected screen height 480.
=== debian11 (32 bit French report) ===
ddraw: ddraw2.c:3911: Test failed: Got unexpected screen width 800. ddraw2.c:3913: Test failed: Got unexpected screen height 600. ddraw2.c:3935: Test failed: Got unexpected screen width 800. ddraw2.c:3937: Test failed: Got unexpected screen height 600. ddraw2.c:3970: Test failed: Got unexpected screen width 800. ddraw2.c:3972: Test failed: Got unexpected screen height 600. ddraw2.c:3993: Test failed: Got unexpected screen width 800. ddraw2.c:3995: Test failed: Got unexpected screen height 600. ddraw2.c:4000: Test failed: Got unexpected screen width 800. ddraw2.c:4002: Test failed: Got unexpected screen height 600. ddraw4.c:2951: Test failed: Expected window style 0x4cf0000, got 0xa40b0000. ddraw4.c:2970: Test failed: Expected (0,0)-(640,480), got (-32000,-32000)-(-31840,-31976). ddraw4.c:2993: Test failed: Expected (0,0)-(640,480), got (-32000,-32000)-(-31840,-31976). ddraw4.c:3013: Test failed: Expected window style 0x4cf0000, got 0xa40b0000. ddraw4.c:3623: Test failed: Expected resolution 640x480, got 720x480. ddraw4.c:3640: Test failed: Expected surface width 640, got 720. ddraw4.c:3661: Test failed: Expected surface width 640, got 720. ddraw4.c:3676: Test failed: Expected surface width 640, got 720. ddraw4.c:3720: Test failed: Got unexpected hr 0. ddraw4.c:3732: Test failed: Expected surface width 640, got 720. ddraw4.c:3773: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw4.c:3786: Test failed: Expected resolution 640x480, got 720x480. ddraw4.c:3803: Test failed: Expected surface width 640, got 720. ddraw4.c:3810: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw4.c:3827: Test failed: Expected message 0x47, but didn't receive it. ddraw4.c:3829: Test failed: Expected screen size 640x480, got 0x0. ddraw4.c:3836: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw4.c:3848: Test failed: Expected surface width 640, got 720. ddraw4.c:3901: Test failed: Expected screen size 2 640x480, got 720x480. ddraw4.c:3909: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw4.c:3921: Test failed: Expected surface width 640, got 720. ddraw7.c:3437: Test failed: Expected (0,0)-(640,480), got (0,0)-(1024,768). ddraw7.c:3474: Test failed: Expected (0,0)-(640,480), got (0,0)-(1024,768).
=== debian11 (32 bit Hindi:India report) ===
ddraw: ddraw1.c:14301: Test failed: Expected window rect (640,0)-(1664,737), got (0,0)-(1024,737). ddraw1.c:14316: Test failed: Expected window rect (640,0)-(1664,737), got (0,0)-(1024,737). ddraw2.c:4088: Test failed: Got a different mode. ddraw7.c:3491: Test failed: Expected message 0x47, but didn't receive it. ddraw7.c:3493: Test failed: Expected screen size 640x480, got 0x0. ddraw7.c:3500: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3512: Test failed: Expected surface width 640, got 720. ddraw7.c:3565: Test failed: Expected screen size 2 640x480, got 720x480. ddraw7.c:3573: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3585: Test failed: Expected surface width 640, got 720.
=== debian11 (32 bit Chinese:China report) ===
ddraw: ddraw7.c:3064: Test failed: Expected message 0x7e, but didn't receive it. ddraw7.c:3112: Test failed: Expected message 0x47, but didn't receive it. ddraw7.c:3114: Test failed: Expected screen size 640x480, got 0x0. ddraw7.c:3120: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3144: Test failed: Expected surface width 640, got 720. ddraw7.c:3150: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3157: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3162: Test failed: Expected surface width 640, got 720. ddraw7.c:3177: Test failed: Expected surface width 640, got 720. ddraw7.c:3183: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3206: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3228: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3233: Test failed: Expected surface width 640, got 720. ddraw7.c:3254: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3274: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3287: Test failed: Expected resolution 640x480, got 720x480. ddraw7.c:3304: Test failed: Expected surface width 640, got 720. ddraw7.c:3310: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3320: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3325: Test failed: Expected surface width 640, got 720. ddraw7.c:3340: Test failed: Expected surface width 640, got 720. ddraw7.c:3346: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3369: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3382: Test failed: Got unexpected hr 0. ddraw7.c:3384: Test failed: Got unexpected hr 0. ddraw7.c:3391: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3396: Test failed: Expected surface width 640, got 720. ddraw7.c:3417: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3437: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3450: Test failed: Expected resolution 640x480, got 720x480. ddraw7.c:3467: Test failed: Expected surface width 640, got 720. ddraw7.c:3474: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3491: Test failed: Expected message 0x47, but didn't receive it. ddraw7.c:3493: Test failed: Expected screen size 640x480, got 0x0. ddraw7.c:3500: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3512: Test failed: Expected surface width 640, got 720. ddraw7.c:3565: Test failed: Expected screen size 2 640x480, got 720x480. ddraw7.c:3573: Test failed: Expected (0,0)-(640,480), got (0,0)-(720,480). ddraw7.c:3585: Test failed: Expected surface width 640, got 720.
Report validation errors: ddraw7: Timeout
=== debian11 (build log) ===
WineRunWineTest.pl:error: The task timed out
=== debian11 (32 bit WoW report) ===
ddraw: ddraw4.c:706: Test failed: Got ddraw state 0x887600e1 on message 0x47, expected 0. ddraw4.c:699: Test failed: Got unexpected wparam 1 for message 5, expected 0. ddraw4.c:706: Test failed: Got ddraw state 0x887600e1 on message 0x5, expected 0. ddraw4.c:3387: Test failed: Expected message 0x7e, but didn't receive it. ddraw4.c:3394: Test failed: Got unexpected screen size 720x480. ddraw4.c:3450: Test failed: Expected screen size 1024x768, got 720x480. ddraw4.c:3456: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3480: Test failed: Expected surface width 1024, got 720. ddraw4.c:3486: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3493: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3498: Test failed: Expected surface width 1024, got 720. ddraw4.c:3513: Test failed: Expected surface width 1024, got 720. ddraw4.c:3519: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3542: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3564: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3569: Test failed: Expected surface width 1024, got 720. ddraw4.c:3571: Test failed: Expected surface height 768, got 480. ddraw4.c:3590: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3610: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3623: Test failed: Expected resolution 1024x768, got 720x480. ddraw4.c:3640: Test failed: Expected surface width 1024, got 720. ddraw4.c:3642: Test failed: Expected surface height 768, got 480. ddraw4.c:3646: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3656: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3661: Test failed: Expected surface width 1024, got 720. ddraw4.c:3663: Test failed: Expected surface height 768, got 480. ddraw4.c:3676: Test failed: Expected surface width 1024, got 720. ddraw4.c:3678: Test failed: Expected surface height 768, got 480. ddraw4.c:3682: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3705: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3727: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3732: Test failed: Expected surface width 1024, got 720. ddraw4.c:3753: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3773: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3786: Test failed: Expected resolution 1024x768, got 720x480. ddraw4.c:3803: Test failed: Expected surface width 1024, got 720. ddraw4.c:3810: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3829: Test failed: Expected screen size 1024x768, got 720x480. ddraw4.c:3836: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3848: Test failed: Expected surface width 1024, got 720. ddraw4.c:3901: Test failed: Expected screen size 2 1024x768, got 720x480. ddraw4.c:3909: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw4.c:3921: Test failed: Expected surface width 1024, got 720.
=== debian11 (64 bit WoW report) ===
ddraw: ddraw1.c:14279: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,768). ddraw1.c:14335: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,768). ddraw1.c:14342: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,768). ddraw1.c:14279: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,737). ddraw1.c:14301: Test failed: Expected window rect (640,0)-(1664,737), got (0,0)-(1024,737). ddraw1.c:14316: Test failed: Expected window rect (640,0)-(1664,737), got (0,0)-(1024,737). ddraw1.c:14335: Test failed: Expect window rect (0,0)-(640,480), got (1024,0)-(2048,737). ddraw1.c:14342: Test failed: Expect window rect (0,0)-(640,480), got (1024,0)-(2048,737). ddraw2.c:707: Test failed: Got unexpected wparam 1 for message 5, expected 0. ddraw2.c:3150: Test failed: Expected message 0x7e, but didn't receive it. ddraw2.c:3155: Test failed: Got unexpected screen size 800x600. ddraw2.c:3211: Test failed: Expected screen size 640x480, got 800x600. ddraw2.c:3217: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3241: Test failed: Expected surface width 640, got 800. ddraw2.c:3243: Test failed: Expected surface height 480, got 600. ddraw2.c:3247: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3254: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3259: Test failed: Expected surface width 640, got 800. ddraw2.c:3261: Test failed: Expected surface height 480, got 600. ddraw2.c:3274: Test failed: Expected surface width 640, got 800. ddraw2.c:3276: Test failed: Expected surface height 480, got 600. ddraw2.c:3280: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3303: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3332: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3337: Test failed: Expected surface width 640, got 800. ddraw2.c:3339: Test failed: Expected surface height 480, got 600. ddraw2.c:3358: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3378: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3391: Test failed: Expected resolution 640x480, got 800x600. ddraw2.c:3408: Test failed: Expected surface width 640, got 800. ddraw2.c:3410: Test failed: Expected surface height 480, got 600. ddraw2.c:3414: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3424: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3429: Test failed: Expected surface width 640, got 800. ddraw2.c:3431: Test failed: Expected surface height 480, got 600. ddraw2.c:3444: Test failed: Expected surface width 640, got 800. ddraw2.c:3446: Test failed: Expected surface height 480, got 600. ddraw2.c:3450: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3473: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3495: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3500: Test failed: Expected surface width 640, got 800. ddraw2.c:3502: Test failed: Expected surface height 480, got 600. ddraw2.c:3521: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3541: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3554: Test failed: Expected resolution 640x480, got 800x600. ddraw2.c:3571: Test failed: Expected surface width 640, got 800. ddraw2.c:3573: Test failed: Expected surface height 480, got 600. ddraw2.c:3578: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3597: Test failed: Expected screen size 640x480, got 800x600. ddraw2.c:3604: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3616: Test failed: Expected surface width 640, got 800. ddraw2.c:3618: Test failed: Expected surface height 480, got 600. ddraw2.c:3669: Test failed: Expected screen size 2 640x480, got 800x600. ddraw2.c:3677: Test failed: Expected (0,0)-(640,480), got (0,0)-(800,600). ddraw2.c:3689: Test failed: Expected surface width 640, got 800. ddraw2.c:3691: Test failed: Expected surface height 480, got 600. ddraw2.c:4411: Test failed: Display mode restored after good ddraw1::SetCooperativeLevel call ddraw2.c:15259: Test failed: Expect window rect (0,0)-(640,480), got (1024,0)-(2048,737). ddraw2.c:15266: Test failed: Expect window rect (0,0)-(640,480), got (1024,0)-(2048,737).
Signed-off-by: Stefan Dösinger stefan@codeweavers.com
(Forgive me for sending this from my gmail address. My CW email setup has some problem. Check the PGP cert if you don't trust that it's me)