This is a different workaround that gives the same results both on Windows and on Wine. It intercepts WM_NCCALCSIZE message to request empty non-client area when a window is fullscreen, which makes the client area cover the whole window, regardless of the decorations.
We could also check whether the application changed the default non-client area dimensions before overriding it. However, as OpenGL or Vulkan aren't able to render over non-client areas anyway, I believe it is fine to override it when Wine D3D is supposed to render fullscreen.
Rémi Bernon (8): dxgi/tests: Add more complete window style checks. wined3d: Override WM_NCCALCSIZE for fullscreen windows. wined3d: Add WINED3D_SWAPCHAIN_NO_STYLE_CHANGES flag. d3d8: Do not modify window styles anymore. d3d9: Do not modify window styles anymore. ddraw: Do not modify window styles anymore. wined3d: Use the same style changes as native DXGI. wined3d: Always restore styles if changes are allowed.
dlls/d3d8/device.c | 3 +- dlls/d3d8/tests/device.c | 10 ++--- dlls/d3d9/device.c | 3 +- dlls/d3d9/tests/d3d9ex.c | 14 ++++--- dlls/d3d9/tests/device.c | 14 ++++--- dlls/ddraw/ddraw.c | 3 +- dlls/ddraw/tests/ddraw1.c | 8 ++-- dlls/ddraw/tests/ddraw2.c | 8 ++-- dlls/ddraw/tests/ddraw4.c | 8 ++-- dlls/ddraw/tests/ddraw7.c | 8 ++-- dlls/dxgi/tests/dxgi.c | 79 ++++++++++++++++++++++++++++++++++----- dlls/wined3d/device.c | 26 +++++++++++++ dlls/wined3d/swapchain.c | 68 ++++++++++----------------------- include/wine/wined3d.h | 1 + 14 files changed, 161 insertions(+), 92 deletions(-)
This isn't very useful but it exposes the style mask used by native DXGI when creating fullscreen windows.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dxgi/tests/dxgi.c | 80 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 71 insertions(+), 9 deletions(-)
diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c index e2b5df7b272..d0d521f069c 100644 --- a/dlls/dxgi/tests/dxgi.c +++ b/dlls/dxgi/tests/dxgi.c @@ -310,6 +310,8 @@ static BOOL output_belongs_to_adapter(IDXGIOutput *output, IDXGIAdapter *adapter
struct fullscreen_state { + DWORD style; + DWORD exstyle; RECT window_rect; RECT client_rect; HMONITOR monitor; @@ -329,6 +331,9 @@ static void capture_fullscreen_state_(unsigned int line, struct fullscreen_state MONITORINFOEXW monitor_info; BOOL ret;
+ state->style = GetWindowLongA(window, GWL_STYLE); + state->exstyle = GetWindowLongA(window, GWL_EXSTYLE); + ret = GetWindowRect(window, &state->window_rect); ok_(__FILE__, line)(ret, "GetWindowRect failed.\n"); ret = GetClientRect(window, &state->client_rect); @@ -345,8 +350,13 @@ static void capture_fullscreen_state_(unsigned int line, struct fullscreen_state
#define check_fullscreen_state(a, b) check_fullscreen_state_(__LINE__, a, b) static void check_fullscreen_state_(unsigned int line, const struct fullscreen_state *state, - const struct fullscreen_state *expected_state) + const struct fullscreen_state *expected_state, BOOL windowed) { + todo_wine_if(!windowed) + ok_(__FILE__, line)((state->style & ~WS_VISIBLE) == (expected_state->style & ~WS_VISIBLE), + "Got style %x, expected %x.\n", (DWORD)(state->style & ~WS_VISIBLE), (DWORD)(expected_state->style & ~WS_VISIBLE)); + ok_(__FILE__, line)((state->exstyle & ~WS_EX_TOPMOST) == (expected_state->exstyle & ~WS_EX_TOPMOST), + "Got exstyle %x, expected %x.\n", (DWORD)(state->exstyle & ~WS_EX_TOPMOST), (DWORD)(expected_state->exstyle & ~WS_EX_TOPMOST)); ok_(__FILE__, line)(EqualRect(&state->window_rect, &expected_state->window_rect), "Got window rect %s, expected %s.\n", wine_dbgstr_rect(&state->window_rect), wine_dbgstr_rect(&expected_state->window_rect)); @@ -361,13 +371,13 @@ static void check_fullscreen_state_(unsigned int line, const struct fullscreen_s wine_dbgstr_rect(&state->monitor_rect), wine_dbgstr_rect(&expected_state->monitor_rect)); }
-#define check_window_fullscreen_state(a, b) check_window_fullscreen_state_(__LINE__, a, b) +#define check_window_fullscreen_state(a, b) check_window_fullscreen_state_(__LINE__, a, b, TRUE) static void check_window_fullscreen_state_(unsigned int line, HWND window, - const struct fullscreen_state *expected_state) + const struct fullscreen_state *expected_state, BOOL windowed) { struct fullscreen_state current_state; capture_fullscreen_state_(line, ¤t_state, window); - check_fullscreen_state_(line, ¤t_state, expected_state); + check_fullscreen_state_(line, ¤t_state, expected_state, windowed); }
#define check_swapchain_fullscreen_state(a, b) check_swapchain_fullscreen_state_(__LINE__, a, b) @@ -381,7 +391,8 @@ static void check_swapchain_fullscreen_state_(unsigned int line, IDXGISwapChain
hr = IDXGISwapChain_GetDesc(swapchain, &swapchain_desc); ok_(__FILE__, line)(hr == S_OK, "Failed to get swapchain desc, hr %#x.\n", hr); - check_window_fullscreen_state_(line, swapchain_desc.OutputWindow, &expected_state->fullscreen_state); + check_window_fullscreen_state_(line, swapchain_desc.OutputWindow, &expected_state->fullscreen_state, + swapchain_desc.Windowed);
ok_(__FILE__, line)(swapchain_desc.Windowed == !expected_state->fullscreen, "Got windowed %#x, expected %#x.\n", @@ -446,6 +457,9 @@ static void compute_expected_swapchain_fullscreen_state_after_fullscreen_change_ new_height = mode_desc.Height; }
+ state->fullscreen_state.style &= WS_VISIBLE | WS_CLIPSIBLINGS; + state->fullscreen_state.exstyle &= WS_EX_TOPMOST; + state->fullscreen = TRUE; if (swapchain_desc->Flags & DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH) { @@ -1842,6 +1856,7 @@ static void test_create_swapchain(void) creation_desc.OutputWindow = CreateWindowA("static", "dxgi_test", WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, 0, 0, 222, 222, 0, 0, 0, 0); + expected_state.fullscreen_state.style = WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX; SetRect(&expected_state.fullscreen_state.window_rect, 0, 0, 222, 222); GetClientRect(creation_desc.OutputWindow, expected_client_rect); expected_width = expected_client_rect->right; @@ -1864,6 +1879,8 @@ static void test_create_swapchain(void) creation_desc.OutputWindow = CreateWindowA("static", "dxgi_test", WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 1, 1, 0, 0, 0, 0, 0, 0); + expected_state.fullscreen_state.style = WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; + expected_state.fullscreen_state.exstyle = 0; SetRect(&expected_state.fullscreen_state.window_rect, 1, 1, 1, 1); SetRectEmpty(expected_client_rect); expected_width = expected_height = 8; @@ -5307,12 +5324,22 @@ static void test_swapchain_window_styles(void) WS_EX_WINDOWEDGE}, {WS_OVERLAPPED | WS_VISIBLE, 0, WS_OVERLAPPED | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CAPTION, WS_EX_WINDOWEDGE}, + {WS_OVERLAPPED | WS_MAXIMIZE, 0, + WS_OVERLAPPED | WS_MAXIMIZE | WS_CLIPSIBLINGS | WS_CAPTION, WS_EX_WINDOWEDGE}, + {WS_OVERLAPPED | WS_MINIMIZE, 0, + WS_OVERLAPPED | WS_MINIMIZE | WS_CLIPSIBLINGS | WS_CAPTION, WS_EX_WINDOWEDGE}, {WS_CAPTION | WS_DISABLED, WS_EX_TOPMOST, WS_CAPTION | WS_DISABLED | WS_CLIPSIBLINGS, WS_EX_TOPMOST | WS_EX_WINDOWEDGE}, {WS_CAPTION | WS_DISABLED | WS_VISIBLE, WS_EX_TOPMOST, WS_CAPTION | WS_DISABLED | WS_VISIBLE | WS_CLIPSIBLINGS, WS_EX_TOPMOST | WS_EX_WINDOWEDGE}, {WS_CAPTION | WS_SYSMENU | WS_VISIBLE, WS_EX_APPWINDOW, WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_CLIPSIBLINGS, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE}, + {WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_BORDER | WS_DLGFRAME | + WS_VSCROLL | WS_HSCROLL | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, + 0, + WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_BORDER | WS_DLGFRAME | + WS_VSCROLL | WS_HSCROLL | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, + WS_EX_WINDOWEDGE}, };
if (!(device = create_device(0))) @@ -5354,8 +5381,9 @@ static void test_swapchain_window_styles(void) ok(exstyle == tests[i].expected_exstyle, "Test %u: Got exstyle %#x, expected %#x.\n", i, exstyle, tests[i].expected_exstyle);
- fullscreen_style = tests[i].expected_style & (WS_VISIBLE | WS_DISABLED | WS_CLIPSIBLINGS); - fullscreen_exstyle = (tests[i].expected_exstyle & WS_EX_APPWINDOW) | WS_EX_TOPMOST; + fullscreen_style = tests[i].expected_style & ~(WS_POPUP | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_THICKFRAME | WS_SYSMENU | WS_DLGFRAME | WS_BORDER); + fullscreen_exstyle = tests[i].expected_exstyle & ~(WS_EX_DLGMODALFRAME | WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE | WS_EX_CONTEXTHELP); + fullscreen_exstyle |= WS_EX_TOPMOST;
hr = IDXGIFactory_CreateSwapChain(factory, (IUnknown *)device, &swapchain_desc, &swapchain); ok(hr == S_OK, "Failed to create swapchain, hr %#x.\n", hr); @@ -5398,15 +5426,49 @@ static void test_swapchain_window_styles(void) ok(exstyle == tests[i].expected_exstyle, "Test %u: Got exstyle %#x, expected %#x.\n", i, exstyle, tests[i].expected_exstyle);
+ 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, "Test %u: Got style %#x, expected %#x.\n", + i, style, fullscreen_style); + ok(exstyle == fullscreen_exstyle, "Test %u: Got exstyle %#x, expected %#x.\n", + i, exstyle, fullscreen_exstyle); + + SetWindowLongW(swapchain_desc.OutputWindow, GWL_STYLE, fullscreen_style); + SetWindowLongW(swapchain_desc.OutputWindow, GWL_EXSTYLE, fullscreen_exstyle); + + hr = IDXGISwapChain_SetFullscreenState(swapchain, FALSE, NULL); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + style = GetWindowLongA(swapchain_desc.OutputWindow, GWL_STYLE); + exstyle = GetWindowLongA(swapchain_desc.OutputWindow, GWL_EXSTYLE); + todo_wine + ok(style == tests[i].expected_style, "Test %u: Got style %#x, expected %#x.\n", + i, style, tests[i].expected_style); + todo_wine + ok(exstyle == tests[i].expected_exstyle, "Test %u: Got exstyle %#x, expected %#x.\n", + i, exstyle, tests[i].expected_exstyle); + } + else + { + skip("Test %u: Could not change fullscreen state.\n", i); + } + refcount = IDXGISwapChain_Release(swapchain); ok(!refcount, "IDXGISwapChain has %u references left.\n", refcount);
style = GetWindowLongA(swapchain_desc.OutputWindow, GWL_STYLE); exstyle = GetWindowLongA(swapchain_desc.OutputWindow, GWL_EXSTYLE); - todo_wine_if(!(tests[i].expected_style & WS_VISIBLE)) + todo_wine ok(style == tests[i].expected_style, "Test %u: Got style %#x, expected %#x.\n", i, style, tests[i].expected_style); - todo_wine_if(!(tests[i].expected_exstyle & WS_EX_TOPMOST)) + todo_wine ok(exstyle == tests[i].expected_exstyle, "Test %u: Got exstyle %#x, expected %#x.\n", i, exstyle, tests[i].expected_exstyle);
This still passes the message to the application window proc, but then overrides the result if the window is fullscreen.
Some games restore window style after D3D has changed the window state to fullscreen. Overriding this message will make sure the client area always covers the full screen, regardless of window styles.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/wined3d/device.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 54efdb05a73..1ff616bc0f7 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5652,6 +5652,32 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL } }
+ /* Testing shows we shouldn't hook that message, but doing it allows us + * to create fullscreen exclusive windows without altering window styles. */ + if (message == WM_NCCALCSIZE && wparam == TRUE) + { + unsigned int i = device->swapchain_count; + NCCALCSIZE_PARAMS params = *(NCCALCSIZE_PARAMS*)lparam; + LRESULT res; + + if (unicode) + res = CallWindowProcW(proc, window, message, wparam, lparam); + else + res = CallWindowProcA(proc, window, message, wparam, lparam); + + while (i--) + { + if (device->swapchains[i]->state.device_window == window && + !device->swapchains[i]->state.desc.windowed) + { + *(NCCALCSIZE_PARAMS*)lparam = params; + return 0; + } + } + + return res; + } + if (unicode) return CallWindowProcW(proc, window, message, wparam, lparam); else
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/wined3d/swapchain.c | 34 +++++++++++++++++++++------------- include/wine/wined3d.h | 1 + 2 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index c5fd2879c05..ad91f506cc1 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -1544,6 +1544,7 @@ static LONG fullscreen_exstyle(LONG exstyle) HRESULT wined3d_swapchain_state_setup_fullscreen(struct wined3d_swapchain_state *state, HWND window, unsigned int w, unsigned int h) { + unsigned int window_pos_flags = SWP_SHOWWINDOW | SWP_NOACTIVATE; LONG style, exstyle; BOOL filter;
@@ -1564,17 +1565,22 @@ HRESULT wined3d_swapchain_state_setup_fullscreen(struct wined3d_swapchain_state state->style = GetWindowLongW(window, GWL_STYLE); state->exstyle = GetWindowLongW(window, GWL_EXSTYLE);
- style = fullscreen_style(state->style); - exstyle = fullscreen_exstyle(state->exstyle); + filter = wined3d_filter_messages(window, TRUE); + + if (!(state->desc.flags & WINED3D_SWAPCHAIN_NO_STYLE_CHANGES)) + { + style = fullscreen_style(state->style); + exstyle = fullscreen_exstyle(state->exstyle);
- TRACE("Old style was %08x, %08x, setting to %08x, %08x.\n", - state->style, state->exstyle, style, exstyle); + TRACE("Old style was %08x, %08x, setting to %08x, %08x.\n", + state->style, state->exstyle, style, exstyle);
- filter = wined3d_filter_messages(window, TRUE); + SetWindowLongW(window, GWL_STYLE, style); + SetWindowLongW(window, GWL_EXSTYLE, exstyle); + window_pos_flags |= SWP_FRAMECHANGED; + }
- SetWindowLongW(window, GWL_STYLE, style); - SetWindowLongW(window, GWL_EXSTYLE, exstyle); - SetWindowPos(window, HWND_TOPMOST, 0, 0, w, h, SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_NOACTIVATE); + SetWindowPos(window, HWND_TOPMOST, 0, 0, w, h, window_pos_flags);
wined3d_filter_messages(window, filter);
@@ -1584,7 +1590,7 @@ HRESULT wined3d_swapchain_state_setup_fullscreen(struct wined3d_swapchain_state void wined3d_swapchain_state_restore_from_fullscreen(struct wined3d_swapchain_state *state, HWND window, const RECT *window_rect) { - unsigned int window_pos_flags = SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOACTIVATE; + unsigned int window_pos_flags = SWP_NOZORDER | SWP_NOACTIVATE; LONG style, exstyle; RECT rect = {0}; BOOL filter; @@ -1604,19 +1610,21 @@ void wined3d_swapchain_state_restore_from_fullscreen(struct wined3d_swapchain_st state->style ^= (state->style ^ style) & WS_VISIBLE; state->exstyle ^= (state->exstyle ^ exstyle) & WS_EX_TOPMOST;
- TRACE("Restoring window style of window %p to %08x, %08x.\n", - window, state->style, state->exstyle); - filter = wined3d_filter_messages(window, TRUE);
/* Only restore the style if the application didn't modify it during the * fullscreen phase. Some applications change it before calling Reset() * when switching between windowed and fullscreen modes (HL2), some * depend on the original style (Eve Online). */ - if (style == fullscreen_style(state->style) && exstyle == fullscreen_exstyle(state->exstyle)) + if (!(state->desc.flags & WINED3D_SWAPCHAIN_NO_STYLE_CHANGES) && + style == fullscreen_style(state->style) && exstyle == fullscreen_exstyle(state->exstyle)) { + TRACE("Restoring window style of window %p to %08x, %08x.\n", + window, state->style, state->exstyle); + SetWindowLongW(window, GWL_STYLE, state->style); SetWindowLongW(window, GWL_EXSTYLE, state->exstyle); + window_pos_flags |= SWP_FRAMECHANGED; }
if (window_rect) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 923f184d96d..aab3780d08f 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -906,6 +906,7 @@ enum wined3d_shader_type #define WINED3D_SWAPCHAIN_GDI_COMPATIBLE 0x00008000u #define WINED3D_SWAPCHAIN_IMPLICIT 0x00010000u #define WINED3D_SWAPCHAIN_HOOK 0x00020000u +#define WINED3D_SWAPCHAIN_NO_STYLE_CHANGES 0x00040000u
#define WINED3DDP_MAXTEXCOORD 8
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d3d8/device.c | 3 ++- dlls/d3d8/tests/device.c | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index d6253a4a2bf..a62b6120a8b 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -300,7 +300,8 @@ static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapch swapchain_desc->auto_depth_stencil_format = wined3dformat_from_d3dformat(present_parameters->AutoDepthStencilFormat); swapchain_desc->flags - = (present_parameters->Flags & D3DPRESENTFLAGS_MASK) | WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH; + = (present_parameters->Flags & D3DPRESENTFLAGS_MASK) | WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH | + WINED3D_SWAPCHAIN_NO_STYLE_CHANGES; swapchain_desc->refresh_rate = present_parameters->FullScreen_RefreshRateInHz; swapchain_desc->auto_restore_display_mode = TRUE;
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 008395df1a6..533bae42d12 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -3784,12 +3784,12 @@ static void test_window_style(void)
style = GetWindowLongA(device_window, GWL_STYLE); expected_style = device_style | WS_VISIBLE; - todo_wine ok(style == expected_style || broken(style == (expected_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + ok(style == expected_style || broken(style == (expected_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, "Expected device window style %#x, got %#x.\n", expected_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 */, + ok(style == expected_style || broken(style == (expected_style & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, "Expected device window extended style %#x, got %#x.\n", expected_style, style);
@@ -3804,7 +3804,7 @@ static void test_window_style(void) ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); GetClientRect(device_window, &r); - todo_wine ok(!EqualRect(&r, &fullscreen_rect) || broken(!(style & WS_THICKFRAME)) /* w1064v1809 */, + ok(!EqualRect(&r, &fullscreen_rect) || broken(!(style & WS_THICKFRAME)) /* w1064v1809 */, "Client rect and window rect are equal.\n"); GetWindowRect(focus_window, &r); ok(EqualRect(&r, &focus_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(&focus_rect), @@ -3838,11 +3838,11 @@ static void test_window_style(void)
style = GetWindowLongA(device_window, GWL_STYLE); expected_style = device_style | WS_MINIMIZE | WS_VISIBLE; - todo_wine ok(style == expected_style, "Expected device window style %#x, got %#x.\n", + ok(style == expected_style, "Expected device window style %#x, got %#x.\n", expected_style, style); style = GetWindowLongA(device_window, GWL_EXSTYLE); expected_style = device_exstyle | WS_EX_TOPMOST; - todo_wine ok(style == expected_style, "Expected device window extended style %#x, got %#x.\n", + ok(style == expected_style, "Expected device window extended style %#x, got %#x.\n", expected_style, style);
style = GetWindowLongA(focus_window, GWL_STYLE);
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d3d9/device.c | 3 ++- dlls/d3d9/tests/d3d9ex.c | 14 +++++++++----- dlls/d3d9/tests/device.c | 14 +++++++++----- 3 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 8ffe04c94d7..274c1f8278c 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -344,7 +344,8 @@ static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapch swapchain_desc->auto_depth_stencil_format = wined3dformat_from_d3dformat(present_parameters->AutoDepthStencilFormat); swapchain_desc->flags - = (present_parameters->Flags & D3DPRESENTFLAGS_MASK) | WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH; + = (present_parameters->Flags & D3DPRESENTFLAGS_MASK) | WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH | + WINED3D_SWAPCHAIN_NO_STYLE_CHANGES; if ((present_parameters->Flags & D3DPRESENTFLAG_LOCKABLE_BACKBUFFER) && (is_gdi_compat_wined3dformat(swapchain_desc->backbuffer_format) /* WINED3DFMT_UNKNOWN creates the swapchain with the current diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c index 17dd3c5c12e..a47ec8ef917 100644 --- a/dlls/d3d9/tests/d3d9ex.c +++ b/dlls/d3d9/tests/d3d9ex.c @@ -3515,7 +3515,8 @@ static void test_window_style(void)
style = GetWindowLongA(device_window, GWL_STYLE); expected_style = device_style; - todo_wine ok(style == expected_style || broken(style == (expected_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + todo_wine_if (!(tests[i].style_flags & WS_VISIBLE)) + ok(style == expected_style || broken(style == (expected_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, "Expected device window style %#x, got %#x, i=%u.\n", expected_style, style, i); style = GetWindowLongA(device_window, GWL_EXSTYLE); @@ -3539,7 +3540,7 @@ static void test_window_style(void) ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s, i=%u.\n", wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r), i); GetClientRect(device_window, &r2); - todo_wine ok(!EqualRect(&r, &r2) || broken(!(style & WS_THICKFRAME)) /* w1064v1809 */, + ok(!EqualRect(&r, &r2) || broken(!(style & WS_THICKFRAME)) /* w1064v1809 */, "Client rect and window rect are equal, i=%u.\n", i); GetWindowRect(focus_window, &r); ok(EqualRect(&r, &focus_rect), "Expected %s, got %s, i=%u.\n", @@ -3593,12 +3594,14 @@ static void test_window_style(void) ok(!!device, "Failed to create a D3D device.\n"); style = GetWindowLongA(device_window, GWL_STYLE); expected_style = device_style | tests[i].create2_style; - todo_wine ok(style == expected_style || broken(style == (expected_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + todo_wine_if ((tests[i].device_flags & CREATE_DEVICE_NOWINDOWCHANGES) && !(tests[i].style_flags & WS_VISIBLE)) + ok(style == expected_style || broken(style == (expected_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, "Expected device window style %#x, got %#x, i=%u.\n", expected_style, style, i); style = GetWindowLongA(device_window, GWL_EXSTYLE); expected_style = device_exstyle | tests[i].create2_exstyle; - todo_wine ok(style == expected_style || broken(style == (expected_style & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + todo_wine_if ((tests[i].device_flags & CREATE_DEVICE_NOWINDOWCHANGES)) + ok(style == expected_style || broken(style == (expected_style & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, "Expected device window extended style %#x, got %#x, i=%u.\n", expected_style, style, i);
@@ -3626,7 +3629,8 @@ static void test_window_style(void)
style = GetWindowLongA(device_window, GWL_STYLE); expected_style = device_style | tests[i].focus_loss_style; - todo_wine ok(style == expected_style, "Expected device window style %#x, got %#x, i=%u.\n", + todo_wine_if (!(tests[i].style_flags & WS_VISIBLE)) + ok(style == expected_style, "Expected device window style %#x, got %#x, i=%u.\n", expected_style, style, i); style = GetWindowLongA(device_window, GWL_EXSTYLE); expected_style = device_exstyle; diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index d00a26b942c..5ce763f2494 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -4859,12 +4859,14 @@ static void test_window_style(void)
style = GetWindowLongA(device_window, GWL_STYLE); expected_style = device_style | tests[i].style; - todo_wine ok(style == expected_style || broken(style == (expected_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, + todo_wine_if (tests[i].device_flags & CREATE_DEVICE_NOWINDOWCHANGES) + ok(style == expected_style || broken(style == (expected_style & ~WS_OVERLAPPEDWINDOW)) /* w1064v1809 */, "Expected device window style %#x, got %#x, i=%u.\n", expected_style, style, i); style = GetWindowLongA(device_window, GWL_EXSTYLE); expected_style = device_exstyle | tests[i].exstyle; - todo_wine ok(style == expected_style || broken(style == (expected_style & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, + todo_wine_if (tests[i].device_flags & CREATE_DEVICE_NOWINDOWCHANGES) + ok(style == expected_style || broken(style == (expected_style & ~WS_EX_OVERLAPPEDWINDOW)) /* w1064v1809 */, "Expected device window extended style %#x, got %#x, i=%u.\n", expected_style, style, i);
@@ -4883,7 +4885,7 @@ static void test_window_style(void) ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s, i=%u.\n", wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r), i); GetClientRect(device_window, &r2); - todo_wine ok(!EqualRect(&r, &r2) || broken(!(style & WS_THICKFRAME)) /* w1064v1809 */, + ok(!EqualRect(&r, &r2) || broken(!(style & WS_THICKFRAME)) /* w1064v1809 */, "Client rect and window rect are equal, i=%u.\n", i); GetWindowRect(focus_window, &r); ok(EqualRect(&r, &focus_rect), "Expected %s, got %s, i=%u.\n", @@ -4919,11 +4921,13 @@ static void test_window_style(void)
style = GetWindowLongA(device_window, GWL_STYLE); expected_style = device_style | tests[i].focus_loss_style | tests[i].style; - todo_wine ok(style == expected_style, "Expected device window style %#x, got %#x, i=%u.\n", + todo_wine_if (tests[i].device_flags & CREATE_DEVICE_NOWINDOWCHANGES) + ok(style == expected_style, "Expected device window style %#x, got %#x, i=%u.\n", expected_style, style, i); style = GetWindowLongA(device_window, GWL_EXSTYLE); expected_style = device_exstyle | tests[i].exstyle; - todo_wine ok(style == expected_style, "Expected device window extended style %#x, got %#x, i=%u.\n", + todo_wine_if (tests[i].device_flags & CREATE_DEVICE_NOWINDOWCHANGES) + ok(style == expected_style, "Expected device window extended style %#x, got %#x, i=%u.\n", expected_style, style, i);
style = GetWindowLongA(focus_window, GWL_STYLE);
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/ddraw/ddraw.c | 3 ++- dlls/ddraw/tests/ddraw1.c | 8 ++++---- dlls/ddraw/tests/ddraw2.c | 8 ++++---- dlls/ddraw/tests/ddraw4.c | 8 ++++---- dlls/ddraw/tests/ddraw7.c | 8 ++++---- 5 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 17a02bbc05d..97cf8c57480 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -571,7 +571,8 @@ 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; + swapchain_desc.flags = WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH | WINED3D_SWAPCHAIN_IMPLICIT | + WINED3D_SWAPCHAIN_NO_STYLE_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 98b83334122..09410f11bb1 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -2446,7 +2446,7 @@ static void test_window_style(void) ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); GetClientRect(window, &r); - todo_wine ok(!EqualRect(&r, &fullscreen_rect), "Client rect and window rect are equal.\n"); + ok(!EqualRect(&r, &fullscreen_rect), "Client rect and window rect are equal.\n");
ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); @@ -2479,16 +2479,16 @@ static void test_window_style(void) 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); + ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp);
ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); tmp = GetWindowLongA(window, GWL_STYLE); expected_style = style | WS_VISIBLE | WS_MINIMIZE; - todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + 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); + ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp);
ref = IDirectDraw_Release(ddraw); ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 7dfb35d2d3a..6a370665812 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -2499,7 +2499,7 @@ static void test_window_style(void) ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); GetClientRect(window, &r); - todo_wine ok(!EqualRect(&r, &fullscreen_rect), "Client rect and window rect are equal.\n"); + ok(!EqualRect(&r, &fullscreen_rect), "Client rect and window rect are equal.\n");
ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); @@ -2532,16 +2532,16 @@ static void test_window_style(void) 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); + ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp);
ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); tmp = GetWindowLongA(window, GWL_STYLE); expected_style = style | WS_VISIBLE | WS_MINIMIZE; - todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + 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); + ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp);
ref = IDirectDraw2_Release(ddraw); ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index e1d5bac18bb..8e642493fd6 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -2740,7 +2740,7 @@ static void test_window_style(void) ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); GetClientRect(window, &r); - todo_wine ok(!EqualRect(&r, &fullscreen_rect), "Client rect and window rect are equal.\n"); + ok(!EqualRect(&r, &fullscreen_rect), "Client rect and window rect are equal.\n");
ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); @@ -2773,16 +2773,16 @@ static void test_window_style(void) 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); + ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp);
ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); tmp = GetWindowLongA(window, GWL_STYLE); expected_style = style | WS_VISIBLE | WS_MINIMIZE; - todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + 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); + ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp);
ref = IDirectDraw4_Release(ddraw); ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 3ad44991863..e975090f8e4 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -2389,7 +2389,7 @@ static void test_window_style(void) ok(EqualRect(&r, &fullscreen_rect), "Expected %s, got %s.\n", wine_dbgstr_rect(&fullscreen_rect), wine_dbgstr_rect(&r)); GetClientRect(window, &r); - todo_wine ok(!EqualRect(&r, &fullscreen_rect), "Client rect and window rect are equal.\n"); + ok(!EqualRect(&r, &fullscreen_rect), "Client rect and window rect are equal.\n");
ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); @@ -2422,16 +2422,16 @@ static void test_window_style(void) 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); + ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp);
ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); tmp = GetWindowLongA(window, GWL_STYLE); expected_style = style | WS_VISIBLE | WS_MINIMIZE; - todo_wine ok(tmp == expected_style, "Expected window style %#x, got %#x.\n", expected_style, tmp); + 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); + ok(tmp == expected_style, "Expected window extended style %#x, got %#x.\n", expected_style, tmp);
ref = IDirectDraw7_Release(ddraw); ok(ref == 0, "The ddraw object was not properly freed: refcount %u.\n", ref);
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=66923
Your paranoid android.
=== w8 (32 bit report) ===
ddraw: ddraw4.c:3497: Test failed: Got unexpected hr 0x887601c2.
=== w864 (64 bit report) ===
ddraw: ddraw4.c:3479: Test failed: Failed to create surface, hr 0x887601c2. 0c0c:ddraw4: unhandled exception c0000005 at 00000000004AEF33
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dxgi/tests/dxgi.c | 4 ++-- dlls/wined3d/swapchain.c | 22 ++-------------------- 2 files changed, 4 insertions(+), 22 deletions(-)
diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c index d0d521f069c..44666515d19 100644 --- a/dlls/dxgi/tests/dxgi.c +++ b/dlls/dxgi/tests/dxgi.c @@ -5403,7 +5403,7 @@ static void test_swapchain_window_styles(void) { style = GetWindowLongA(swapchain_desc.OutputWindow, GWL_STYLE); exstyle = GetWindowLongA(swapchain_desc.OutputWindow, GWL_EXSTYLE); - todo_wine + todo_wine_if(!(tests[i].expected_style & WS_VISIBLE)) ok(style == fullscreen_style, "Test %u: Got style %#x, expected %#x.\n", i, style, fullscreen_style); ok(exstyle == fullscreen_exstyle, "Test %u: Got exstyle %#x, expected %#x.\n", @@ -5434,7 +5434,7 @@ static void test_swapchain_window_styles(void) { style = GetWindowLongA(swapchain_desc.OutputWindow, GWL_STYLE); exstyle = GetWindowLongA(swapchain_desc.OutputWindow, GWL_EXSTYLE); - todo_wine + todo_wine_if(!(tests[i].expected_style & WS_VISIBLE)) ok(style == fullscreen_style, "Test %u: Got style %#x, expected %#x.\n", i, style, fullscreen_style); ok(exstyle == fullscreen_exstyle, "Test %u: Got exstyle %#x, expected %#x.\n", diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index ad91f506cc1..49f30792a7a 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -1524,28 +1524,10 @@ HRESULT CDECL wined3d_swapchain_state_resize_target(struct wined3d_swapchain_sta return WINED3D_OK; }
-static LONG fullscreen_style(LONG style) -{ - /* Make sure the window is managed, otherwise we won't get keyboard input. */ - style |= WS_POPUP | WS_SYSMENU; - style &= ~(WS_CAPTION | WS_THICKFRAME); - - return style; -} - -static LONG fullscreen_exstyle(LONG exstyle) -{ - /* Filter out window decorations. */ - exstyle &= ~(WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE); - - return exstyle; -} - HRESULT wined3d_swapchain_state_setup_fullscreen(struct wined3d_swapchain_state *state, HWND window, unsigned int w, unsigned int h) { unsigned int window_pos_flags = SWP_SHOWWINDOW | SWP_NOACTIVATE; - LONG style, exstyle; BOOL filter;
TRACE("Setting up window %p for fullscreen mode.\n", window); @@ -1569,8 +1551,8 @@ HRESULT wined3d_swapchain_state_setup_fullscreen(struct wined3d_swapchain_state
if (!(state->desc.flags & WINED3D_SWAPCHAIN_NO_STYLE_CHANGES)) { - style = fullscreen_style(state->style); - exstyle = fullscreen_exstyle(state->exstyle); + LONG style = state->style & ~(WS_POPUP | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_THICKFRAME | WS_SYSMENU | WS_DLGFRAME | WS_BORDER); + LONG exstyle = state->exstyle & ~(WS_EX_DLGMODALFRAME | WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE | WS_EX_CONTEXTHELP);
TRACE("Old style was %08x, %08x, setting to %08x, %08x.\n", state->style, state->exstyle, style, exstyle);
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=66924
Your paranoid android.
=== w1064v1809 (64 bit report) ===
dxgi: dxgi.c:5080: Test failed: Got unexpected message 0x31f, hwnd 00000000001602C0, wparam 0x1, lparam 0.
=== debiant (build log) ===
/home/winetest/tools/testbot/var/wine-win32/dlls/wined3d/../../../wine/dlls/wined3d/swapchain.c:1602: undefined reference to `fullscreen_style' /usr/bin/ld: /home/winetest/tools/testbot/var/wine-win32/dlls/wined3d/../../../wine/dlls/wined3d/swapchain.c:1602: undefined reference to `fullscreen_exstyle' collect2: error: ld returned 1 exit status Task: The win32 build failed
=== debiant (build log) ===
/home/winetest/tools/testbot/var/wine-wow64/dlls/wined3d/../../../wine/dlls/wined3d/swapchain.c:1602: undefined reference to `fullscreen_style' /usr/bin/ld: /home/winetest/tools/testbot/var/wine-wow64/dlls/wined3d/../../../wine/dlls/wined3d/swapchain.c:1602: undefined reference to `fullscreen_exstyle' collect2: error: ld returned 1 exit status Task: The wow64 build failed
On 3/11/20 7:49 PM, Marvin wrote:
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=66924
Your paranoid android.
=== w1064v1809 (64 bit report) ===
dxgi: dxgi.c:5080: Test failed: Got unexpected message 0x31f, hwnd 00000000001602C0, wparam 0x1, lparam 0.
=== debiant (build log) ===
/home/winetest/tools/testbot/var/wine-win32/dlls/wined3d/../../../wine/dlls/wined3d/swapchain.c:1602: undefined reference to `fullscreen_style' /usr/bin/ld: /home/winetest/tools/testbot/var/wine-win32/dlls/wined3d/../../../wine/dlls/wined3d/swapchain.c:1602: undefined reference to `fullscreen_exstyle' collect2: error: ld returned 1 exit status Task: The win32 build failed
=== debiant (build log) ===
/home/winetest/tools/testbot/var/wine-wow64/dlls/wined3d/../../../wine/dlls/wined3d/swapchain.c:1602: undefined reference to `fullscreen_style' /usr/bin/ld: /home/winetest/tools/testbot/var/wine-wow64/dlls/wined3d/../../../wine/dlls/wined3d/swapchain.c:1602: undefined reference to `fullscreen_exstyle' collect2: error: ld returned 1 exit status Task: The wow64 build failed
The last two patches order should be inverted to fix the link error, I believe the test fixes are independent. Sorry for the mix up.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dxgi/tests/dxgi.c | 11 ++++------- dlls/wined3d/swapchain.c | 22 ++-------------------- 2 files changed, 6 insertions(+), 27 deletions(-)
diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c index 44666515d19..0a11df9b1db 100644 --- a/dlls/dxgi/tests/dxgi.c +++ b/dlls/dxgi/tests/dxgi.c @@ -352,7 +352,6 @@ static void capture_fullscreen_state_(unsigned int line, struct fullscreen_state static void check_fullscreen_state_(unsigned int line, const struct fullscreen_state *state, const struct fullscreen_state *expected_state, BOOL windowed) { - todo_wine_if(!windowed) ok_(__FILE__, line)((state->style & ~WS_VISIBLE) == (expected_state->style & ~WS_VISIBLE), "Got style %x, expected %x.\n", (DWORD)(state->style & ~WS_VISIBLE), (DWORD)(expected_state->style & ~WS_VISIBLE)); ok_(__FILE__, line)((state->exstyle & ~WS_EX_TOPMOST) == (expected_state->exstyle & ~WS_EX_TOPMOST), @@ -5239,7 +5238,6 @@ static void test_swapchain_window_messages(void) goto done; } flush_events(); - todo_wine ok(!expect_messages->message || broken(!expect_messages_broken->message), "Expected message %#x or %#x.\n", expect_messages->message, expect_messages_broken->message); @@ -5270,7 +5268,6 @@ static void test_swapchain_window_messages(void) hr = IDXGIFactory_CreateSwapChain(factory, (IUnknown *)device, &swapchain_desc, &swapchain); ok(hr == S_OK, "Failed to create swapchain, hr %#x.\n", hr); flush_events(); - todo_wine ok(!expect_messages->message || broken(!expect_messages_broken->message), "Expected message %#x or %#x.\n", expect_messages->message, expect_messages_broken->message); @@ -5448,10 +5445,10 @@ static void test_swapchain_window_styles(void)
style = GetWindowLongA(swapchain_desc.OutputWindow, GWL_STYLE); exstyle = GetWindowLongA(swapchain_desc.OutputWindow, GWL_EXSTYLE); - todo_wine + todo_wine_if(!(tests[i].expected_style & WS_VISIBLE)) ok(style == tests[i].expected_style, "Test %u: Got style %#x, expected %#x.\n", i, style, tests[i].expected_style); - todo_wine + todo_wine_if(!(tests[i].expected_exstyle & WS_EX_TOPMOST)) ok(exstyle == tests[i].expected_exstyle, "Test %u: Got exstyle %#x, expected %#x.\n", i, exstyle, tests[i].expected_exstyle); } @@ -5465,10 +5462,10 @@ static void test_swapchain_window_styles(void)
style = GetWindowLongA(swapchain_desc.OutputWindow, GWL_STYLE); exstyle = GetWindowLongA(swapchain_desc.OutputWindow, GWL_EXSTYLE); - todo_wine + todo_wine_if(!(tests[i].expected_style & WS_VISIBLE)) ok(style == tests[i].expected_style, "Test %u: Got style %#x, expected %#x.\n", i, style, tests[i].expected_style); - todo_wine + todo_wine_if(!(tests[i].expected_exstyle & WS_EX_TOPMOST)) ok(exstyle == tests[i].expected_exstyle, "Test %u: Got exstyle %#x, expected %#x.\n", i, exstyle, tests[i].expected_exstyle);
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 49f30792a7a..4dff7f4a303 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -1572,34 +1572,16 @@ HRESULT wined3d_swapchain_state_setup_fullscreen(struct wined3d_swapchain_state void wined3d_swapchain_state_restore_from_fullscreen(struct wined3d_swapchain_state *state, HWND window, const RECT *window_rect) { - unsigned int window_pos_flags = SWP_NOZORDER | SWP_NOACTIVATE; - LONG style, exstyle; + unsigned int window_pos_flags = SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOZORDER; RECT rect = {0}; BOOL filter;
if (!state->style && !state->exstyle) return;
- style = GetWindowLongW(window, GWL_STYLE); - exstyle = GetWindowLongW(window, GWL_EXSTYLE); - - /* These flags are set by wined3d_device_setup_fullscreen_window, not the - * application, and we want to ignore them in the test below, since it's - * not the application's fault that they changed. Additionally, we want to - * preserve the current status of these flags (i.e. don't restore them) to - * more closely emulate the behavior of Direct3D, which leaves these flags - * alone when returning to windowed mode. */ - state->style ^= (state->style ^ style) & WS_VISIBLE; - state->exstyle ^= (state->exstyle ^ exstyle) & WS_EX_TOPMOST; - filter = wined3d_filter_messages(window, TRUE);
- /* Only restore the style if the application didn't modify it during the - * fullscreen phase. Some applications change it before calling Reset() - * when switching between windowed and fullscreen modes (HL2), some - * depend on the original style (Eve Online). */ - if (!(state->desc.flags & WINED3D_SWAPCHAIN_NO_STYLE_CHANGES) && - style == fullscreen_style(state->style) && exstyle == fullscreen_exstyle(state->exstyle)) + if (!(state->desc.flags & WINED3D_SWAPCHAIN_NO_STYLE_CHANGES)) { TRACE("Restoring window style of window %p to %08x, %08x.\n", window, state->style, state->exstyle);