[PATCH 5/8] d3d9: Do not modify window styles anymore.
Rémi Bernon
rbernon at codeweavers.com
Wed Mar 11 09:36:31 CDT 2020
Signed-off-by: Rémi Bernon <rbernon at 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);
--
2.25.0
More information about the wine-devel
mailing list