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 ---
This is a regression from last year but I completely forgot about it. Last time, it got no reviews, unfortunately, so it would be nice to have it fixed during this year's code freeze.
dlls/ddraw/ddraw.c | 18 ++++++----- 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, 270 insertions(+), 8 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 5b70bb4..848b1d9 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,9 +582,11 @@ 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.flags = WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH - | WINED3D_SWAPCHAIN_IMPLICIT | WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES; + swapchain_desc.windowed = !(cooplevel & DDSCL_FULLSCREEN); + swapchain_desc.flags = WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH | WINED3D_SWAPCHAIN_IMPLICIT; + + if ((cooplevel & DDSCL_NOWINDOWCHANGES) || window != GetActiveWindow()) + swapchain_desc.flags |= WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES;
if (ddraw->flags & DDRAW_NO3D) return wined3d_swapchain_create(ddraw->wined3d_device, &swapchain_desc, @@ -640,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;
@@ -650,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; @@ -776,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 @@ -945,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 c9f2aea..f16e428 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -2636,6 +2636,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); hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 7285c1c..2d488ae 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -2714,6 +2714,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); hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 07afc44..ec828ac 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -2950,6 +2950,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); hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 29fa343..c66d521 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -2615,6 +2615,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); hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "SetCooperativeLevel failed, hr %#x.\n", hr);
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/ddraw/ddraw.c | 3 +++ dlls/ddraw/tests/ddraw1.c | 2 +- dlls/ddraw/tests/ddraw2.c | 2 +- dlls/ddraw/tests/ddraw4.c | 2 +- dlls/ddraw/tests/ddraw7.c | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 848b1d9..be73157 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 f16e428..edd66b0 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -2699,7 +2699,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 2d488ae..07e63b9 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -2777,7 +2777,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 ec828ac..a6dfb3a 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -3013,7 +3013,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 c66d521..b0392e1 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -2678,7 +2678,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);
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=104530
Your paranoid android.
=== w1064v1507 (32 bit report) ===
ddraw: ddraw7.c:18741: Test failed: Got unexpected color 0x00000040.
=== w1064v1809 (32 bit report) ===
ddraw: ddraw7.c:18741: Test failed: Got unexpected color 0x00000040.
=== debian11 (32 bit Arabic:Morocco report) ===
ddraw: ddraw7.c:630: Test failed: Got ddraw state 0x887600e1 on message 0x47, expected 0. ddraw7.c:623: Test failed: Got unexpected wparam 1 for message 5, expected 0. ddraw7.c:630: Test failed: Got ddraw state 0x887600e1 on message 0x5, expected 0. ddraw7.c:3051: Test failed: Expected message 0x7e, but didn't receive it. ddraw7.c:3058: Test failed: Got unexpected screen size 720x480. ddraw7.c:3114: Test failed: Expected screen size 1024x768, got 720x480. ddraw7.c:3120: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3144: Test failed: Expected surface width 1024, got 720. ddraw7.c:3146: Test failed: Expected surface height 768, got 480. ddraw7.c:3150: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3157: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3162: Test failed: Expected surface width 1024, got 720. ddraw7.c:3164: Test failed: Expected surface height 768, got 480. ddraw7.c:3177: Test failed: Expected surface width 1024, got 720. ddraw7.c:3179: Test failed: Expected surface height 768, got 480. ddraw7.c:3183: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3206: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3215: Test failed: Got unexpected hr 0. ddraw7.c:3228: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3233: Test failed: Expected surface width 1024, got 720. ddraw7.c:3235: Test failed: Expected surface height 768, got 480. ddraw7.c:3254: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3274: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3287: Test failed: Expected resolution 1024x768, got 720x480. ddraw7.c:3304: Test failed: Expected surface width 1024, got 720. ddraw7.c:3306: Test failed: Expected surface height 768, got 480. ddraw7.c:3310: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3320: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3325: Test failed: Expected surface width 1024, got 720. ddraw7.c:3327: Test failed: Expected surface height 768, got 480. ddraw7.c:3340: Test failed: Expected surface width 1024, got 720. ddraw7.c:3342: Test failed: Expected surface height 768, got 480. ddraw7.c:3346: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3369: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3378: Test failed: Got unexpected hr 0. ddraw7.c:3391: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3396: Test failed: Expected surface width 1024, got 720. ddraw7.c:3398: Test failed: Expected surface height 768, got 480. ddraw7.c:3417: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3437: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3450: Test failed: Expected resolution 1024x768, got 720x480. ddraw7.c:3467: Test failed: Expected surface width 1024, got 720. ddraw7.c:3469: Test failed: Expected surface height 768, got 480. ddraw7.c:3474: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3493: Test failed: Expected screen size 1024x768, got 720x480. ddraw7.c:3500: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3512: Test failed: Expected surface width 1024, got 720. ddraw7.c:3514: Test failed: Expected surface height 768, got 480. ddraw7.c:3565: Test failed: Expected screen size 2 1024x768, got 720x480. ddraw7.c:3573: Test failed: Expected (0,0)-(1024,768), got (0,0)-(720,480). ddraw7.c:3585: Test failed: Expected surface width 1024, got 720. ddraw7.c:3587: Test failed: Expected surface height 768, got 480.
=== debian11 (32 bit German report) ===
ddraw: ddraw7.c:3112: Test failed: Expected message 0x47, but didn't receive it. ddraw7.c:3114: Test failed: Expected screen size 1024x768, got 0x0. ddraw7.c:3120: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw7.c:3144: Test failed: Expected surface width 1024, got 640. ddraw7.c:3146: Test failed: Expected surface height 768, got 480. ddraw7.c:3150: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw7.c:3157: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw7.c:3162: Test failed: Expected surface width 1024, got 640. ddraw7.c:3164: Test failed: Expected surface height 768, got 480. ddraw7.c:3177: Test failed: Expected surface width 1024, got 640. ddraw7.c:3179: Test failed: Expected surface height 768, got 480. ddraw7.c:3183: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw7.c:3206: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw7.c:3219: Test failed: Got unexpected hr 0. ddraw7.c:3221: Test failed: Got unexpected hr 0. ddraw7.c:3228: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw7.c:3233: Test failed: Expected surface width 1024, got 640. ddraw7.c:3235: Test failed: Expected surface height 768, got 480. ddraw7.c:3254: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw7.c:3274: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw7.c:3287: Test failed: Expected resolution 1024x768, got 640x480. ddraw7.c:3304: Test failed: Expected surface width 1024, got 640. ddraw7.c:3306: Test failed: Expected surface height 768, got 480. ddraw7.c:3310: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw7.c:3320: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw7.c:3325: Test failed: Expected surface width 1024, got 640. ddraw7.c:3327: Test failed: Expected surface height 768, got 480. ddraw7.c:3340: Test failed: Expected surface width 1024, got 640. ddraw7.c:3342: Test failed: Expected surface height 768, got 480. ddraw7.c:3346: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw7.c:3369: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,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)-(1024,768), got (0,0)-(640,480). ddraw7.c:3396: Test failed: Expected surface width 1024, got 640. ddraw7.c:3398: Test failed: Expected surface height 768, got 480. ddraw7.c:3417: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw7.c:3437: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw7.c:3450: Test failed: Expected resolution 1024x768, got 640x480. ddraw7.c:3467: Test failed: Expected surface width 1024, got 640. ddraw7.c:3469: Test failed: Expected surface height 768, got 480. ddraw7.c:3474: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw7.c:3491: Test failed: Expected message 0x5, but didn't receive it. ddraw7.c:3493: Test failed: Expected screen size 1024x768, got 0x0. ddraw7.c:3500: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw7.c:3512: Test failed: Expected surface width 1024, got 640. ddraw7.c:3514: Test failed: Expected surface height 768, got 480. ddraw7.c:3565: Test failed: Expected screen size 2 1024x768, got 640x480. ddraw7.c:3573: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw7.c:3585: Test failed: Expected surface width 1024, got 640. ddraw7.c:3587: Test failed: Expected surface height 768, got 480.
=== debian11 (32 bit Hebrew:Israel report) ===
ddraw: ddraw4.c:4312: Test failed: Got a different mode. ddraw7.c:2614: Test failed: Expected window style 0x4cf0000, got 0xb40b0000. ddraw7.c:2616: Test failed: Expected window extended style 0x100, got 0. ddraw7.c:2647: Test failed: Expected window style 0x4cf0000, got 0xb40b0000. ddraw7.c:2650: Test failed: Expected window extended style 0x108, got 0x8. ddraw7.c:2656: Test failed: Expected window style 0x4cf0000, got 0xb40b0000. ddraw7.c:2659: Test failed: Expected window extended style 0x108, got 0x8. ddraw7.c:2679: Test failed: Expected window style 0x4cf0000, got 0xb40b0000. ddraw7.c:2681: Test failed: Expected window extended style 0x100, got 0. ddraw7.c:18507: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw7.c:18525: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw7.c:18532: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw7.c:18507: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,737). ddraw7.c:18525: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw7.c:18532: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737).
=== debian11 (32 bit Hindi:India report) ===
ddraw: ddraw1.c:14279: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw1.c:14297: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw1.c:14304: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw1.c:14279: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,737). ddraw1.c:14297: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,737). ddraw1.c:14304: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,737). ddraw2.c:3554: Test failed: Expected resolution 800x600, got 640x480. ddraw2.c:3571: Test failed: Expected surface width 800, got 640. ddraw2.c:3573: Test failed: Expected surface height 600, got 480. ddraw2.c:3595: Test failed: Expected message 0x5, but didn't receive it. ddraw2.c:3597: Test failed: Expected screen size 800x600, got 0x0. ddraw2.c:3604: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw2.c:3616: Test failed: Expected surface width 800, got 640. ddraw2.c:3618: Test failed: Expected surface height 600, got 480. ddraw2.c:3669: Test failed: Expected screen size 2 800x600, got 640x480. ddraw2.c:3677: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw2.c:3689: Test failed: Expected surface width 800, got 640. ddraw2.c:3691: Test failed: Expected surface height 600, got 480. ddraw2.c:15203: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw2.c:15221: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw2.c:15228: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw2.c:15203: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,737). ddraw2.c:15221: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw2.c:15228: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw4.c:3394: Test failed: Got unexpected screen size 640x480. ddraw4.c:3400: Test failed: Expected message 0x7e, but didn't receive it. ddraw4.c:3448: Test failed: Expected message 0x47, but didn't receive it. ddraw4.c:3450: Test failed: Expected screen size 800x600, got 0x0. ddraw4.c:3456: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3480: Test failed: Expected surface width 800, got 640. ddraw4.c:3482: Test failed: Expected surface height 600, got 480. ddraw4.c:3486: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3493: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3498: Test failed: Expected surface width 800, got 640. ddraw4.c:3500: Test failed: Expected surface height 600, got 480. ddraw4.c:3513: Test failed: Expected surface width 800, got 640. ddraw4.c:3515: Test failed: Expected surface height 600, got 480. ddraw4.c:3519: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3542: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3555: Test failed: Got unexpected hr 0. ddraw4.c:3557: Test failed: Got unexpected hr 0. ddraw4.c:3564: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3569: Test failed: Expected surface width 800, got 640. ddraw4.c:3571: Test failed: Expected surface height 600, got 480. ddraw4.c:3590: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3610: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3623: Test failed: Expected resolution 800x600, got 640x480. ddraw4.c:3640: Test failed: Expected surface width 800, got 640. ddraw4.c:3642: Test failed: Expected surface height 600, got 480. ddraw4.c:3646: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3656: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3661: Test failed: Expected surface width 800, got 640. ddraw4.c:3663: Test failed: Expected surface height 600, got 480. ddraw4.c:3676: Test failed: Expected surface width 800, got 640. ddraw4.c:3678: Test failed: Expected surface height 600, got 480. ddraw4.c:3682: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3705: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3718: Test failed: Got unexpected hr 0. ddraw4.c:3720: Test failed: Got unexpected hr 0. ddraw4.c:3727: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3732: Test failed: Expected surface width 800, got 640. ddraw4.c:3734: Test failed: Expected surface height 600, got 480. ddraw4.c:3753: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3773: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3786: Test failed: Expected resolution 800x600, got 640x480. ddraw4.c:3803: Test failed: Expected surface width 800, got 640. ddraw4.c:3805: Test failed: Expected surface height 600, got 480. ddraw4.c:3810: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3827: Test failed: Expected message 0x5, but didn't receive it. ddraw4.c:3829: Test failed: Expected screen size 800x600, got 0x0. ddraw4.c:3836: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3848: Test failed: Expected surface width 800, got 640. ddraw4.c:3850: Test failed: Expected surface height 600, got 480. ddraw4.c:3901: Test failed: Expected screen size 2 800x600, got 640x480. ddraw4.c:3909: Test failed: Expected (0,0)-(800,600), got (0,0)-(640,480). ddraw4.c:3921: Test failed: Expected surface width 800, got 640. ddraw4.c:3923: Test failed: Expected surface height 600, got 480. ddraw4.c:18240: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw4.c:18258: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw4.c:18265: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw4.c:18240: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,737). ddraw4.c:18258: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw4.c:18265: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw7.c:18507: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw7.c:18525: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw7.c:18532: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw7.c:18507: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,737). ddraw7.c:18525: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw7.c:18532: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737).
=== debian11 (32 bit Japanese:Japan report) ===
ddraw: ddraw1.c:14279: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw1.c:14297: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw1.c:14304: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw1.c:14279: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,737). ddraw1.c:14297: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw1.c:14304: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw2.c:15203: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw2.c:15221: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw2.c:15228: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw2.c:15203: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,737). ddraw2.c:15221: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw2.c:15228: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737).
=== debian11 (32 bit Chinese:China report) ===
ddraw: ddraw1.c:14279: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw1.c:14297: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw1.c:14304: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw1.c:14279: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,737). ddraw1.c:14297: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw1.c:14304: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw2.c:15203: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw2.c:15221: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw2.c:15228: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw2.c:15203: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,737). ddraw2.c:15221: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw2.c:15228: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw4.c:18240: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw4.c:18258: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw4.c:18265: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw4.c:18240: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,737). ddraw4.c:18258: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw4.c:18265: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw7.c:18507: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw7.c:18525: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw7.c:18532: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw7.c:18507: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,737). ddraw7.c:18525: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw7.c:18532: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737).
=== debian11 (32 bit WoW report) ===
ddraw: ddraw4.c:3786: Test failed: Expected resolution 1024x768, got 720x480. ddraw4.c:3803: Test failed: Expected surface width 1024, got 720. ddraw4.c:3805: Test failed: Expected surface height 768, got 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:3850: Test failed: Expected surface height 768, got 480. 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. ddraw4.c:3923: Test failed: Expected surface height 768, got 480.
=== debian11 (64 bit WoW report) ===
ddraw: ddraw7.c:3823: Test failed: Got unexpected screen width 640. ddraw7.c:3825: Test failed: Got unexpected screen height 480. ddraw7.c:3858: Test failed: Got unexpected screen width 640. ddraw7.c:3860: Test failed: Got unexpected screen height 480. ddraw7.c:3881: Test failed: Got unexpected screen width 640. ddraw7.c:3883: Test failed: Got unexpected screen height 480. ddraw7.c:3888: Test failed: Got unexpected screen width 640. ddraw7.c:3890: Test failed: Got unexpected screen height 480.
On Mon, 27 Dec 2021 at 15:32, Gabriel Ivăncescu gabrielopcode@gmail.com wrote:
@@ -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);
Something similar to patch 1/2 in this series applies here; it's not immediately obvious from the tests whether this is the correct place to do this, or whether something similar should be done for other versions of D3D.
On 28/12/2021 18:16, Henri Verbeet wrote:
On Mon, 27 Dec 2021 at 15:32, Gabriel Ivăncescu gabrielopcode@gmail.com wrote:
@@ -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);
Something similar to patch 1/2 in this series applies here; it's not immediately obvious from the tests whether this is the correct place to do this, or whether something similar should be done for other versions of D3D.
I'll try to test and see what happens with other D3D versions, maybe we already have tests that would start failing if I did... but for this one in particular, I don't think it's possible to move it to wined3d without some ddraw-exclusive flag.
I mean, this only happens with the DDSCL_NOWINDOWCHANGES cooplevel flag, which is ddraw specific to this function. And it happens when the API is called to exit exclusive mode with this flag unset. How is wined3d supposed to know this?
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=104529
Your paranoid android.
=== w1064v1507 (32 bit report) ===
ddraw: 0f54:ddraw2: unhandled exception c0000005 at 73CC7F2E
=== debian11 (32 bit report) ===
ddraw: ddraw4.c:2949: Test failed: Expected window style 0x4cf0000, got 0xb40b0000. ddraw4.c:2951: Test failed: Expected window extended style 0x100, got 0. ddraw4.c:2982: Test failed: Expected window style 0x4cf0000, got 0xb40b0000. ddraw4.c:2985: Test failed: Expected window extended style 0x108, got 0x8. ddraw4.c:2991: Test failed: Expected window style 0x4cf0000, got 0xb40b0000. ddraw4.c:2994: Test failed: Expected window extended style 0x108, got 0x8. ddraw4.c:3014: Test failed: Expected window style 0x4cf0000, got 0xb40b0000. ddraw4.c:18240: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw4.c:18258: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw4.c:18265: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw4.c:18240: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,737). ddraw4.c:18258: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw4.c:18265: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw7.c:18507: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw7.c:18525: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw7.c:18532: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,768). ddraw7.c:18507: Test failed: Expect window rect (0,0)-(800,600), got (0,0)-(1024,737). ddraw7.c:18525: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737). ddraw7.c:18532: Test failed: Expect window rect (0,0)-(800,600), got (1024,0)-(2048,737).
=== debian11 (32 bit Arabic:Morocco report) ===
ddraw: ddraw1.c:5644: Test failed: Failed to attach surface, hr 0x8876000a. ddraw1.c:5647: Test failed: Got unexpected hr 0x8876000a. ddraw1.c:5649: Test failed: Failed to detach surface, hr 0x88760014. ddraw1.c:5652: Test failed: Failed to attach surface, hr 0x8876000a. ddraw1.c:5657: Test failed: Failed to detach surface, hr 0x88760014. ddraw1.c:14297: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,737). ddraw1.c:14304: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,737). ddraw2.c:2713: Test failed: Expected window style 0x4cf0000, got 0xb40b0000. ddraw2.c:2715: Test failed: Expected window extended style 0x100, got 0. ddraw2.c:2746: Test failed: Expected window style 0x4cf0000, got 0xb40b0000. ddraw2.c:2749: Test failed: Expected window extended style 0x108, got 0x8. ddraw2.c:2755: Test failed: Expected window style 0x4cf0000, got 0xb40b0000. ddraw2.c:2758: Test failed: Expected window extended style 0x108, got 0x8. ddraw2.c:2778: Test failed: Expected window style 0x4cf0000, got 0xb40b0000. ddraw2.c:15221: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,737). ddraw2.c:15228: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,737). ddraw4.c:18258: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,737). ddraw4.c:18265: Test failed: Expect window rect (0,0)-(640,480), got (0,0)-(1024,737).
=== debian11 (32 bit French report) ===
ddraw: ddraw2.c:15221: Test failed: Expect window rect (0,0)-(640,480), got (1024,0)-(2048,737). ddraw2.c:15228: Test failed: Expect window rect (0,0)-(640,480), got (1024,0)-(2048,737). ddraw4.c:4194: Test failed: Got unexpected screen width 800. ddraw4.c:4196: Test failed: Got unexpected screen height 600. ddraw4.c:4217: Test failed: Got unexpected screen width 800. ddraw4.c:4219: Test failed: Got unexpected screen height 600. ddraw4.c:4224: Test failed: Got unexpected screen width 800. ddraw4.c:4226: Test failed: Got unexpected screen height 600. ddraw4.c:4419: Test failed: Got a different mode.
=== debian11 (32 bit Hindi:India report) ===
ddraw: ddraw4.c:4333: Test failed: Got a different mode. ddraw7.c:3858: Test failed: Got unexpected screen width 800. ddraw7.c:3860: Test failed: Got unexpected screen height 600. ddraw7.c:3881: Test failed: Got unexpected screen width 800. ddraw7.c:3883: Test failed: Got unexpected screen height 600. ddraw7.c:3888: Test failed: Got unexpected screen width 800. ddraw7.c:3890: Test failed: Got unexpected screen height 600.
=== debian11 (32 bit Japanese:Japan report) ===
ddraw: ddraw1.c:14297: Test failed: Expect window rect (0,0)-(640,480), got (1024,0)-(2048,737). ddraw1.c:14304: 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:3312: Test failed: Got unexpected hr 0. 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:3482: Test failed: Got unexpected hr 0. 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.
=== debian11 (32 bit WoW report) ===
ddraw: ddraw2.c:3873: Test failed: Got unexpected screen width 640. ddraw2.c:3875: Test failed: Got unexpected screen height 480. ddraw2.c:3880: Test failed: Got unexpected screen width 640. ddraw2.c:3882: Test failed: Got unexpected screen height 480. ddraw2.c:3904: Test failed: Got unexpected screen width 640. ddraw2.c:3906: Test failed: Got unexpected screen height 480. ddraw2.c:3911: Test failed: Got unexpected screen width 640. ddraw2.c:3913: Test failed: Got unexpected screen height 480. ddraw2.c:3935: Test failed: Got unexpected screen width 640. ddraw2.c:3937: Test failed: Got unexpected screen height 480. ddraw2.c:3970: Test failed: Got unexpected screen width 640. ddraw2.c:3972: Test failed: Got unexpected screen height 480. ddraw2.c:3993: Test failed: Got unexpected screen width 640. ddraw2.c:3995: Test failed: Got unexpected screen height 480. ddraw2.c:4000: Test failed: Got unexpected screen width 640. ddraw2.c:4002: 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 (64 bit WoW report) ===
ddraw: ddraw1.c:3401: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw1.c:3427: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw1.c:3447: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw1.c:3484: Test failed: Expected (0,0)-(1024,768), got (0,0)-(640,480). ddraw4.c:4097: Test failed: Got unexpected screen width 640. ddraw4.c:4099: Test failed: Got unexpected screen height 480. ddraw4.c:4104: Test failed: Got unexpected screen width 640. ddraw4.c:4106: Test failed: Got unexpected screen height 480. ddraw4.c:4128: Test failed: Got unexpected screen width 640. ddraw4.c:4130: Test failed: Got unexpected screen height 480. ddraw4.c:4135: Test failed: Got unexpected screen width 640. ddraw4.c:4137: Test failed: Got unexpected screen height 480. 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.
On Mon, 27 Dec 2021 at 15:32, Gabriel Ivăncescu gabrielopcode@gmail.com wrote:
This is a regression from last year but I completely forgot about it. Last time, it got no reviews, unfortunately, so it would be nice to have it fixed during this year's code freeze.
I think this got deferred during code freeze last year, because window handling is simply very sensitive. It was then never resubmitted after code freeze.
- if ((cooplevel & DDSCL_NOWINDOWCHANGES) || window != GetActiveWindow())
swapchain_desc.flags |= WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES;
That said, I also remember thinking that doing the GetActiveWindow() check here seems somewhat suspicious. The expected place for that kind of check would be in wined3d_swapchain_state_setup_fullscreen(), and the tests don't seem to provide a justification for doing it here instead. Of course doing it in wined3d_swapchain_state_setup_fullscreen() would raise the question of how this is supposed to behave in other D3D versions, but that seems a question worth raising anyway.
On 28/12/2021 18:15, Henri Verbeet wrote:
On Mon, 27 Dec 2021 at 15:32, Gabriel Ivăncescu gabrielopcode@gmail.com wrote:
This is a regression from last year but I completely forgot about it. Last time, it got no reviews, unfortunately, so it would be nice to have it fixed during this year's code freeze.
I think this got deferred during code freeze last year, because window handling is simply very sensitive. It was then never resubmitted after code freeze.
Ah, I did resend it in this form (the old form sent during code freeze was wrong), and now that I done more tests it does seem slightly off as well but more details below.
- if ((cooplevel & DDSCL_NOWINDOWCHANGES) || window != GetActiveWindow())
swapchain_desc.flags |= WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES;
That said, I also remember thinking that doing the GetActiveWindow() check here seems somewhat suspicious. The expected place for that kind of check would be in wined3d_swapchain_state_setup_fullscreen(), and the tests don't seem to provide a justification for doing it here instead. Of course doing it in wined3d_swapchain_state_setup_fullscreen() would raise the question of how this is supposed to behave in other D3D versions, but that seems a question worth raising anyway.
Okay so I wrote tests for the different D3D versions and it seems it's somewhat version-specific, but the main problem is that I don't know how to fix it in wined3d side, because of the acquire_focus_window which changes the focus *before* the swapchain sets fullscreen. But first, here's roughly the results of how each version works:
ddraw: If it's not active when entering fullscreen, WS_EX_TOPMOST is not set (i.e. doesn't do window changes). This check is done only when entering fullscreen; if the coop level is reset again after to fullscreen while active, even while already being fullscreen, it will set WS_EX_TOPMOST, i.e. it does not "persist".
d3d9: Same as ddraw, where creating the device while not active will not make it topmost. Resetting the device while not active won't make it topmost either, but doing so while active (even if it was created inactive) will.
d3d8: Similar to d3d9, except that it persists. If it's created inactive, it will never set WS_EX_TOPMOST after that during any resets, even if it's active while it's being reset back to fullscreen.
dxgi: Doesn't care about inactive at all, always sets topmost (so current behavior is correct).
This leads me to think a solution outside of wined3d is preferable. However, there's more reasons to it. The problem, as stated, is wined3d_device_acquire_focus_window. This is done before the swapchain is created/sets fullscreen (during reset). And it focuses the window, which means that any checks during setup_fullscreen will always see it active/focused, making them pointless.
Checking whether it's active before acquire_focus_window is easy enough outside of wined3d, but would be pretty ugly in wined3d, having to track extra state and all.
Then there's the difference between versions, where it's easy enough to handle that outside of wined3d, while requiring some sort of new flags (?) for wined3d, especially given that dxgi's current behavior is correct and needs no changes at all.
Sorry, forgot to actually test normal d3d9, I've only tested the extended before, so what I wrote is for d3d9ex.
Normal d3d9 is the same as dxgi: it doesn't care if it's active or not. Which is kinda interesting, didn't expect it to be that different.