Commit 37daa357 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

d3d9/tests: Add test showing WM_SIZE is not sent during fullscreen mode change.

parent 197966fe
...@@ -3367,7 +3367,7 @@ struct message ...@@ -3367,7 +3367,7 @@ struct message
static const struct message *expect_messages; static const struct message *expect_messages;
static HWND device_window, focus_window; static HWND device_window, focus_window;
static LONG windowposchanged_received, syscommand_received; static LONG windowposchanged_received, syscommand_received, wm_size_received;
struct wndproc_thread_param struct wndproc_thread_param
{ {
...@@ -3423,6 +3423,8 @@ static LRESULT CALLBACK test_proc(HWND hwnd, UINT message, WPARAM wparam, LPARAM ...@@ -3423,6 +3423,8 @@ static LRESULT CALLBACK test_proc(HWND hwnd, UINT message, WPARAM wparam, LPARAM
InterlockedIncrement(&windowposchanged_received); InterlockedIncrement(&windowposchanged_received);
else if (message == WM_SYSCOMMAND) else if (message == WM_SYSCOMMAND)
InterlockedIncrement(&syscommand_received); InterlockedIncrement(&syscommand_received);
else if (message == WM_SIZE)
InterlockedIncrement(&wm_size_received);
return DefWindowProcA(hwnd, message, wparam, lparam); return DefWindowProcA(hwnd, message, wparam, lparam);
} }
...@@ -4224,11 +4226,14 @@ done: ...@@ -4224,11 +4226,14 @@ done:
static void test_reset_fullscreen(void) static void test_reset_fullscreen(void)
{ {
struct device_desc device_desc;
D3DDISPLAYMODE d3ddm, d3ddm2;
unsigned int mode_count, i;
IDirect3DDevice9 *device;
WNDCLASSEXA wc = {0}; WNDCLASSEXA wc = {0};
IDirect3DDevice9 *device = NULL;
IDirect3D9 *d3d; IDirect3D9 *d3d;
HRESULT hr;
ATOM atom; ATOM atom;
struct device_desc device_desc;
static const struct message messages[] = static const struct message messages[] =
{ {
/* Windows usually sends wparam = TRUE, except on the testbot, /* Windows usually sends wparam = TRUE, except on the testbot,
...@@ -4279,6 +4284,34 @@ static void test_reset_fullscreen(void) ...@@ -4279,6 +4284,34 @@ static void test_reset_fullscreen(void)
ok(expect_messages->message == 0, "Expected to receive message %#x.\n", expect_messages->message); ok(expect_messages->message == 0, "Expected to receive message %#x.\n", expect_messages->message);
expect_messages = NULL; expect_messages = NULL;
IDirect3D9_GetAdapterDisplayMode(d3d, D3DADAPTER_DEFAULT, &d3ddm);
mode_count = IDirect3D9_GetAdapterModeCount(d3d, D3DADAPTER_DEFAULT, d3ddm.Format);
for (i = 0; i < mode_count; ++i)
{
hr = IDirect3D9_EnumAdapterModes(d3d, D3DADAPTER_DEFAULT, d3ddm.Format, i, &d3ddm2);
ok(SUCCEEDED(hr), "Failed to enumerate display mode, hr %#x.\n", hr);
if (d3ddm2.Width != d3ddm.Width || d3ddm2.Height != d3ddm.Height)
break;
}
if (i == mode_count)
{
skip("Could not find a suitable display mode.\n");
goto cleanup;
}
wm_size_received = 0;
/* Fullscreen mode change. */
device_desc.width = d3ddm2.Width;
device_desc.height = d3ddm2.Height;
device_desc.device_window = device_window;
device_desc.flags = CREATE_DEVICE_FULLSCREEN;
ok(SUCCEEDED(reset_device(device, &device_desc)), "Failed to reset device.\n");
flush_events();
todo_wine ok(!wm_size_received, "Received unexpected WM_SIZE message.\n");
cleanup: cleanup:
if (device) IDirect3DDevice9_Release(device); if (device) IDirect3DDevice9_Release(device);
IDirect3D9_Release(d3d); IDirect3D9_Release(d3d);
......
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