Commit 14373178 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

d3d9/tests: Work around focus-follows-mouse test failures.

Removing WS_VISIBLE without updating the window state with SWP_FRAMECHANGED is enough to trigger d3d9's hidden window codepath (native and in Wine), but doesn't actually hide the window. This prevents unpredictable focus changes on focus follows mouse WMs. Signed-off-by: 's avatarStefan Dösinger <stefan@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 749e280d
...@@ -2954,7 +2954,11 @@ static void test_wndproc(void) ...@@ -2954,7 +2954,11 @@ static void test_wndproc(void)
hr = reset_device(device, &device_desc); hr = reset_device(device, &device_desc);
ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr);
ShowWindow(device_window, SW_HIDE); /* Remove the WS_VISIBLE flag to test hidden windows. This is enough to trigger d3d's hidden
* window codepath, but does not actually hide the window without a SetWindowPos(SWP_FRAMECHANGED)
* call. This way we avoid focus changes and random failures on focus follows mouse WMs. */
device_style = GetWindowLongA(device_window, GWL_STYLE);
SetWindowLongA(device_window, GWL_STYLE, device_style & ~WS_VISIBLE);
flush_events(); flush_events();
expect_messages = focus_loss_messages_hidden; expect_messages = focus_loss_messages_hidden;
......
...@@ -3906,7 +3906,11 @@ static void test_wndproc(void) ...@@ -3906,7 +3906,11 @@ static void test_wndproc(void)
hr = reset_device(device, &device_desc); hr = reset_device(device, &device_desc);
ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed to reset device, hr %#x.\n", hr);
ShowWindow(device_window, SW_HIDE); /* Remove the WS_VISIBLE flag to test hidden windows. This is enough to trigger d3d's hidden
* window codepath, but does not actually hide the window without a SetWindowPos(SWP_FRAMECHANGED)
* call. This way we avoid focus changes and random failures on focus follows mouse WMs. */
device_style = GetWindowLongA(device_window, GWL_STYLE);
SetWindowLongA(device_window, GWL_STYLE, device_style & ~WS_VISIBLE);
flush_events(); flush_events();
expect_messages = focus_loss_messages_hidden; expect_messages = focus_loss_messages_hidden;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment