[PATCH 4/8] wined3d: Don't change the swapchain window z-order if no window changes were requested.
From: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Based on a patch by Rémi Bernon. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> --- This supersedes patch 188406. dlls/d3d9/device.c | 6 ++++++ dlls/d3d9/tests/d3d9ex.c | 6 ++++-- dlls/d3d9/tests/device.c | 2 +- dlls/wined3d/swapchain.c | 7 +++++-- include/wine/wined3d.h | 1 + 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 9b1dac0b58c..0cf9677c97f 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -886,6 +886,7 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_CreateAdditionalSwapChain(ID D3DPRESENT_PARAMETERS *present_parameters, IDirect3DSwapChain9 **swapchain) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); + struct wined3d_device_creation_parameters creation_parameters; struct wined3d_swapchain_desc desc; struct d3d9_swapchain *object; unsigned int swap_interval; @@ -924,6 +925,9 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_CreateAdditionalSwapChain(ID if (!wined3d_swapchain_desc_from_d3d9(&desc, device->d3d_parent->wined3d_outputs[output_idx], present_parameters, device->d3d_parent->extended)) return D3DERR_INVALIDCALL; + wined3d_device_get_creation_parameters(device->wined3d_device, &creation_parameters); + if (creation_parameters.flags & WINED3DCREATE_NOWINDOWCHANGES) + desc.flags |= WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES; swap_interval = wined3dswapinterval_from_d3d(present_parameters->PresentationInterval); if (SUCCEEDED(hr = d3d9_swapchain_create(device, &desc, swap_interval, &object))) *swapchain = (IDirect3DSwapChain9 *)&object->IDirect3DSwapChain9Ex_iface; @@ -4780,6 +4784,8 @@ HRESULT device_init(struct d3d9_device *device, struct d3d9 *parent, struct wine return D3DERR_INVALIDCALL; } swapchain_desc[i].flags |= WINED3D_SWAPCHAIN_IMPLICIT; + if (flags & D3DCREATE_NOWINDOWCHANGES) + swapchain_desc[i].flags |= WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES; } if (FAILED(hr = d3d9_swapchain_create(device, swapchain_desc, diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c index f475d55cc89..76565c4ec2c 100644 --- a/dlls/d3d9/tests/d3d9ex.c +++ b/dlls/d3d9/tests/d3d9ex.c @@ -3574,7 +3574,8 @@ static void test_window_style(void) expected_style, style, i); style = GetWindowLongA(device_window, GWL_EXSTYLE); expected_style = device_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); @@ -3594,7 +3595,8 @@ static void test_window_style(void) expected_style, style, i); style = GetWindowLongA(device_window, GWL_EXSTYLE); expected_style = device_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); diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index a15c04fa455..14ca12ecd87 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -5025,7 +5025,7 @@ static void test_window_style(void) expected_style, style, i); style = GetWindowLongA(device_window, GWL_EXSTYLE); expected_style = device_exstyle | tests[i].exstyle; - todo_wine_if ((tests[i].device_flags & CREATE_DEVICE_NOWINDOWCHANGES) || (tests[i].create_style & WS_VISIBLE)) + todo_wine_if (!(tests[i].device_flags & CREATE_DEVICE_NOWINDOWCHANGES) && (tests[i].create_style & WS_VISIBLE)) ok(style == expected_style, "Expected device window extended style %#x, got %#x, i=%u.\n", expected_style, style, i); diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index e9d62728b48..00d51d6f6d4 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -2065,6 +2065,7 @@ static LONG fullscreen_exstyle(LONG exstyle) HRESULT wined3d_swapchain_state_setup_fullscreen(struct wined3d_swapchain_state *state, HWND window, int x, int y, int width, int height) { + unsigned int window_pos_flags = SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_NOACTIVATE; LONG style, exstyle; BOOL filter; @@ -2082,6 +2083,9 @@ HRESULT wined3d_swapchain_state_setup_fullscreen(struct wined3d_swapchain_state window, state->style, state->exstyle); } + if (state->desc.flags & WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES) + window_pos_flags |= SWP_NOZORDER; + state->style = GetWindowLongW(window, GWL_STYLE); state->exstyle = GetWindowLongW(window, GWL_EXSTYLE); @@ -2095,8 +2099,7 @@ HRESULT wined3d_swapchain_state_setup_fullscreen(struct wined3d_swapchain_state SetWindowLongW(window, GWL_STYLE, style); SetWindowLongW(window, GWL_EXSTYLE, exstyle); - SetWindowPos(window, HWND_TOPMOST, x, y, width, height, - SWP_FRAMECHANGED | SWP_SHOWWINDOW | SWP_NOACTIVATE); + SetWindowPos(window, HWND_TOPMOST, x, y, width, height, window_pos_flags); wined3d_filter_messages(window, filter); diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 346d1d0dfa8..0d40d38c565 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -905,6 +905,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_WINDOW_CHANGES 0x00040000u #define WINED3DDP_MAXTEXCOORD 8 -- 2.20.1
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=74969 Your paranoid android. === w1064v1809_2scr (32 bit report) === d3d9: device.c:5187: Test failed: Didn't receive MOUSEMOVE 1 (75, 75). device.c:5043: Test failed: Failed to set foreground window. device.c:5047: Test failed: Expected device window style 0x34cf0000, got 0x14000000, i=1. device.c:5051: Test failed: Expected device window extended style 0x108, got 0, i=1. device.c:5067: Test failed: Failed to set foreground window. device.c:5043: Test failed: Failed to set foreground window. device.c:5067: Test failed: Failed to set foreground window. device.c:5070: Test failed: Failed to reset device, hr 0x88760868. device.c:5043: Test failed: Failed to set foreground window. device.c:5067: Test failed: Failed to set foreground window. device.c:11438: Test failed: Failed to set foreground window. device.c:11440: Test failed: Got unexpected hr 0. device.c:11442: Test failed: Got unexpected hr 0. device.c:11447: Test failed: Failed to set foreground window. device.c:11449: Test failed: Got unexpected hr 0. device.c:11451: Test failed: Got unexpected hr 0. device.c:11469: Test failed: Failed to set foreground window. device.c:11478: Test failed: Failed to set foreground window. device.c:11493: Test failed: Failed to set foreground window. device.c:11495: Test failed: Got unexpected hr 0. device.c:11499: Test failed: Failed to set foreground window. === w864 (64 bit report) === d3d9: device.c:4271: Test failed: Received WM_WINDOWPOSCHANGED but did not expect it, i=0. === debiant (32 bit report) === d3d9: d3d9ex: Timeout device: Timeout stateblock: Timeout visual: Timeout === debiant (build log) === 0024:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded. 0024:err:winediag:nodrv_CreateWindow The explorer process failed to start. Task: WineTest did not produce the win32_fr_FR report === debiant (32 bit WoW report) === d3d9: d3d9ex: Timeout device: Timeout stateblock: Timeout visual: Timeout === debiant (build log) === 0024:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded. 0024:err:winediag:nodrv_CreateWindow The explorer process failed to start. Task: WineTest did not produce the wow64 report
participants (2)
-
Henri Verbeet -
Marvin