wined3d: Restore display modes for all outputs when doing mode restoration.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5575072e72
commit
b911e56045
|
@ -4326,7 +4326,7 @@ static void test_mode_change(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode);
|
||||
ok(ret, "Failed to get display mode.\n");
|
||||
todo_wine ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth
|
||||
ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth
|
||||
&& devmode.dmPelsHeight == registry_mode.dmPelsHeight,
|
||||
"Expected resolution %ux%u, got %ux%u.\n",
|
||||
registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, devmode.dmPelsWidth, devmode.dmPelsHeight);
|
||||
|
@ -4399,7 +4399,7 @@ static void test_mode_change(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n");
|
||||
ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(NULL, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n");
|
||||
|
@ -4434,7 +4434,7 @@ static void test_mode_change(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n");
|
||||
ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(NULL, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n");
|
||||
|
@ -4517,15 +4517,15 @@ static void test_mode_change(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
hr = IDirect3D8_GetAdapterDisplayMode(d3d8, 1, &d3ddm);
|
||||
ok(hr == S_OK, "GetAdapterDisplayMode failed, hr %#x.\n", hr);
|
||||
todo_wine ok(d3ddm.Width == old_devmode.dmPelsWidth, "Expected width %u, got %u.\n",
|
||||
ok(d3ddm.Width == old_devmode.dmPelsWidth, "Expected width %u, got %u.\n",
|
||||
old_devmode.dmPelsWidth, d3ddm.Width);
|
||||
todo_wine ok(d3ddm.Height == old_devmode.dmPelsHeight, "Expected height %u, got %u.\n",
|
||||
ok(d3ddm.Height == old_devmode.dmPelsHeight, "Expected height %u, got %u.\n",
|
||||
old_devmode.dmPelsHeight, d3ddm.Height);
|
||||
|
||||
refcount = IDirect3DDevice8_Release(device);
|
||||
|
@ -4550,15 +4550,15 @@ static void test_mode_change(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
hr = IDirect3D8_GetAdapterDisplayMode(d3d8, 1, &d3ddm);
|
||||
ok(hr == S_OK, "GetAdapterDisplayMode failed, hr %#x.\n", hr);
|
||||
todo_wine ok(d3ddm.Width == old_devmode.dmPelsWidth, "Expected width %u, got %u.\n",
|
||||
ok(d3ddm.Width == old_devmode.dmPelsWidth, "Expected width %u, got %u.\n",
|
||||
old_devmode.dmPelsWidth, d3ddm.Width);
|
||||
todo_wine ok(d3ddm.Height == old_devmode.dmPelsHeight, "Expected height %u, got %u.\n",
|
||||
ok(d3ddm.Height == old_devmode.dmPelsHeight, "Expected height %u, got %u.\n",
|
||||
old_devmode.dmPelsHeight, d3ddm.Height);
|
||||
ret = restore_display_modes(original_modes, display_count);
|
||||
ok(ret, "Failed to restore display modes.\n");
|
||||
|
@ -4576,7 +4576,7 @@ static void test_mode_change(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight,
|
||||
ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight,
|
||||
"Expected resolution %ux%u, got %ux%u.\n", devmode.dmPelsWidth, devmode.dmPelsHeight,
|
||||
devmode2.dmPelsWidth, devmode2.dmPelsHeight);
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
|
@ -4586,7 +4586,7 @@ static void test_mode_change(void)
|
|||
devmode2.dmPelsWidth, devmode2.dmPelsHeight);
|
||||
hr = IDirect3D8_GetAdapterDisplayMode(d3d8, 1, &d3ddm);
|
||||
ok(hr == S_OK, "GetAdapterDisplayMode failed, hr %#x.\n", hr);
|
||||
todo_wine ok(d3ddm.Width == devmode.dmPelsWidth && d3ddm.Height == devmode.dmPelsHeight,
|
||||
ok(d3ddm.Width == devmode.dmPelsWidth && d3ddm.Height == devmode.dmPelsHeight,
|
||||
"Expected resolution %ux%u, got %ux%u.\n", devmode.dmPelsWidth, devmode.dmPelsHeight,
|
||||
d3ddm.Width, d3ddm.Height);
|
||||
ret = restore_display_modes(original_modes, display_count);
|
||||
|
@ -4613,13 +4613,13 @@ static void test_mode_change(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
hr = IDirect3D8_GetAdapterDisplayMode(d3d8, 1, &d3ddm);
|
||||
ok(hr == S_OK, "GetAdapterDisplayMode failed, hr %#x.\n", hr);
|
||||
todo_wine ok(d3ddm.Width == old_devmode.dmPelsWidth && d3ddm.Height == old_devmode.dmPelsHeight,
|
||||
ok(d3ddm.Width == old_devmode.dmPelsWidth && d3ddm.Height == old_devmode.dmPelsHeight,
|
||||
"Expected resolution %ux%u, got %ux%u.\n", old_devmode.dmPelsWidth,
|
||||
old_devmode.dmPelsHeight, d3ddm.Width, d3ddm.Height);
|
||||
|
||||
|
@ -4645,13 +4645,13 @@ static void test_mode_change(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
hr = IDirect3D8_GetAdapterDisplayMode(d3d8, 1, &d3ddm);
|
||||
ok(hr == S_OK, "GetAdapterDisplayMode failed, hr %#x.\n", hr);
|
||||
todo_wine ok(d3ddm.Width == old_devmode.dmPelsWidth && d3ddm.Height == old_devmode.dmPelsHeight,
|
||||
ok(d3ddm.Width == old_devmode.dmPelsWidth && d3ddm.Height == old_devmode.dmPelsHeight,
|
||||
"Expected resolution %ux%u, got %ux%u.\n", old_devmode.dmPelsWidth,
|
||||
old_devmode.dmPelsHeight, d3ddm.Width, d3ddm.Height);
|
||||
|
||||
|
|
|
@ -5413,7 +5413,7 @@ static void test_mode_change(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode);
|
||||
ok(ret, "Failed to get display mode.\n");
|
||||
todo_wine ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth
|
||||
ok(devmode.dmPelsWidth == registry_mode.dmPelsWidth
|
||||
&& devmode.dmPelsHeight == registry_mode.dmPelsHeight,
|
||||
"Expected resolution %ux%u, got %ux%u.\n",
|
||||
registry_mode.dmPelsWidth, registry_mode.dmPelsHeight, devmode.dmPelsWidth, devmode.dmPelsHeight);
|
||||
|
@ -5486,7 +5486,7 @@ static void test_mode_change(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n");
|
||||
ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(NULL, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n");
|
||||
|
@ -5521,7 +5521,7 @@ static void test_mode_change(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n");
|
||||
ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(NULL, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n");
|
||||
|
@ -5604,15 +5604,15 @@ static void test_mode_change(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
hr = IDirect3D9_GetAdapterDisplayMode(d3d9, 1, &d3ddm);
|
||||
ok(hr == S_OK, "GetAdapterDisplayMode failed, hr %#x.\n", hr);
|
||||
todo_wine ok(d3ddm.Width == old_devmode.dmPelsWidth, "Expected width %u, got %u.\n",
|
||||
ok(d3ddm.Width == old_devmode.dmPelsWidth, "Expected width %u, got %u.\n",
|
||||
old_devmode.dmPelsWidth, d3ddm.Width);
|
||||
todo_wine ok(d3ddm.Height == old_devmode.dmPelsHeight, "Expected height %u, got %u.\n",
|
||||
ok(d3ddm.Height == old_devmode.dmPelsHeight, "Expected height %u, got %u.\n",
|
||||
old_devmode.dmPelsHeight, d3ddm.Height);
|
||||
|
||||
refcount = IDirect3DDevice9_Release(device);
|
||||
|
@ -5637,15 +5637,15 @@ static void test_mode_change(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
hr = IDirect3D9_GetAdapterDisplayMode(d3d9, 1, &d3ddm);
|
||||
ok(hr == S_OK, "GetAdapterDisplayMode failed, hr %#x.\n", hr);
|
||||
todo_wine ok(d3ddm.Width == old_devmode.dmPelsWidth, "Expected width %u, got %u.\n",
|
||||
ok(d3ddm.Width == old_devmode.dmPelsWidth, "Expected width %u, got %u.\n",
|
||||
old_devmode.dmPelsWidth, d3ddm.Width);
|
||||
todo_wine ok(d3ddm.Height == old_devmode.dmPelsHeight, "Expected height %u, got %u.\n",
|
||||
ok(d3ddm.Height == old_devmode.dmPelsHeight, "Expected height %u, got %u.\n",
|
||||
old_devmode.dmPelsHeight, d3ddm.Height);
|
||||
ret = restore_display_modes(original_modes, display_count);
|
||||
ok(ret, "Failed to restore display modes.\n");
|
||||
|
@ -5663,7 +5663,7 @@ static void test_mode_change(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight,
|
||||
ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight,
|
||||
"Expected resolution %ux%u, got %ux%u.\n", devmode.dmPelsWidth, devmode.dmPelsHeight,
|
||||
devmode2.dmPelsWidth, devmode2.dmPelsHeight);
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
|
@ -5673,7 +5673,7 @@ static void test_mode_change(void)
|
|||
devmode2.dmPelsWidth, devmode2.dmPelsHeight);
|
||||
hr = IDirect3D9_GetAdapterDisplayMode(d3d9, 1, &d3ddm);
|
||||
ok(hr == S_OK, "GetAdapterDisplayMode failed, hr %#x.\n", hr);
|
||||
todo_wine ok(d3ddm.Width == devmode.dmPelsWidth && d3ddm.Height == devmode.dmPelsHeight,
|
||||
ok(d3ddm.Width == devmode.dmPelsWidth && d3ddm.Height == devmode.dmPelsHeight,
|
||||
"Expected resolution %ux%u, got %ux%u.\n", devmode.dmPelsWidth, devmode.dmPelsHeight,
|
||||
d3ddm.Width, d3ddm.Height);
|
||||
ret = restore_display_modes(original_modes, display_count);
|
||||
|
@ -5700,13 +5700,13 @@ static void test_mode_change(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
hr = IDirect3D9_GetAdapterDisplayMode(d3d9, 1, &d3ddm);
|
||||
ok(hr == S_OK, "GetAdapterDisplayMode failed, hr %#x.\n", hr);
|
||||
todo_wine ok(d3ddm.Width == old_devmode.dmPelsWidth && d3ddm.Height == old_devmode.dmPelsHeight,
|
||||
ok(d3ddm.Width == old_devmode.dmPelsWidth && d3ddm.Height == old_devmode.dmPelsHeight,
|
||||
"Expected resolution %ux%u, got %ux%u.\n", old_devmode.dmPelsWidth,
|
||||
old_devmode.dmPelsHeight, d3ddm.Width, d3ddm.Height);
|
||||
|
||||
|
@ -5732,13 +5732,13 @@ static void test_mode_change(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
hr = IDirect3D9_GetAdapterDisplayMode(d3d9, 1, &d3ddm);
|
||||
ok(hr == S_OK, "GetAdapterDisplayMode failed, hr %#x.\n", hr);
|
||||
todo_wine ok(d3ddm.Width == old_devmode.dmPelsWidth && d3ddm.Height == old_devmode.dmPelsHeight,
|
||||
ok(d3ddm.Width == old_devmode.dmPelsWidth && d3ddm.Height == old_devmode.dmPelsHeight,
|
||||
"Expected resolution %ux%u, got %ux%u.\n", old_devmode.dmPelsWidth,
|
||||
old_devmode.dmPelsHeight, d3ddm.Width, d3ddm.Height);
|
||||
|
||||
|
|
|
@ -698,7 +698,7 @@ static HRESULT WINAPI ddraw7_RestoreDisplayMode(IDirectDraw7 *iface)
|
|||
return DDERR_NOEXCLUSIVEMODE;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr = wined3d_output_set_display_mode(ddraw->wined3d_output, NULL)))
|
||||
if (SUCCEEDED(hr = wined3d_restore_display_modes(ddraw->wined3d)))
|
||||
{
|
||||
ddraw->flags &= ~DDRAW_RESTORE_MODE;
|
||||
if (ddraw->cooperative_level & DDSCL_EXCLUSIVE &&
|
||||
|
|
|
@ -3784,7 +3784,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
|
@ -3805,7 +3805,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
|
@ -3830,7 +3830,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight,
|
||||
ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight,
|
||||
"Expected resolution %ux%u, got %ux%u.\n", devmode.dmPelsWidth, devmode.dmPelsHeight,
|
||||
devmode2.dmPelsWidth, devmode2.dmPelsHeight);
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
|
@ -3860,7 +3860,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
|
@ -3891,7 +3891,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
|
|
|
@ -3944,7 +3944,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
|
@ -3965,7 +3965,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
|
@ -3990,7 +3990,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight,
|
||||
ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight,
|
||||
"Expected resolution %ux%u, got %ux%u.\n", devmode.dmPelsWidth, devmode.dmPelsHeight,
|
||||
devmode2.dmPelsWidth, devmode2.dmPelsHeight);
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
|
@ -4020,7 +4020,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
|
@ -4051,7 +4051,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
|
|
|
@ -4172,7 +4172,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
|
@ -4193,7 +4193,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
|
@ -4218,7 +4218,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight,
|
||||
ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight,
|
||||
"Expected resolution %ux%u, got %ux%u.\n", devmode.dmPelsWidth, devmode.dmPelsHeight,
|
||||
devmode2.dmPelsWidth, devmode2.dmPelsHeight);
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
|
@ -4248,7 +4248,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
|
@ -4279,7 +4279,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
|
|
|
@ -3819,7 +3819,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
|
@ -3840,7 +3840,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
|
@ -3865,7 +3865,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight,
|
||||
ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight,
|
||||
"Expected resolution %ux%u, got %ux%u.\n", devmode.dmPelsWidth, devmode.dmPelsHeight,
|
||||
devmode2.dmPelsWidth, devmode2.dmPelsHeight);
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
|
@ -3895,7 +3895,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
|
@ -3926,7 +3926,7 @@ static void test_coop_level_mode_set_multi(void)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(compare_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
|
|
|
@ -7097,7 +7097,7 @@ static void test_mode_change(IUnknown *device, BOOL is_d3d12)
|
|||
|
||||
ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n");
|
||||
ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(NULL, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(equal_mode_rect(&devmode2, &devmode), "Got a different mode.\n");
|
||||
|
@ -7196,16 +7196,16 @@ static void test_mode_change(IUnknown *device, BOOL is_d3d12)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
ok(equal_mode_rect(&devmode2, &old_devmode), "Got a different mode.\n");
|
||||
hr = IDXGIOutput_GetDesc(second_output, &output_desc);
|
||||
ok(hr == S_OK, "GetDesc failed, hr %#x.\n", hr);
|
||||
todo_wine ok(output_desc.DesktopCoordinates.right - output_desc.DesktopCoordinates.left ==
|
||||
ok(output_desc.DesktopCoordinates.right - output_desc.DesktopCoordinates.left ==
|
||||
old_devmode.dmPelsWidth, "Expected width %u, got %u.\n", old_devmode.dmPelsWidth,
|
||||
output_desc.DesktopCoordinates.right - output_desc.DesktopCoordinates.left);
|
||||
todo_wine ok(output_desc.DesktopCoordinates.bottom - output_desc.DesktopCoordinates.top ==
|
||||
ok(output_desc.DesktopCoordinates.bottom - output_desc.DesktopCoordinates.top ==
|
||||
old_devmode.dmPelsHeight, "Expected height %u, got %u.\n", old_devmode.dmPelsHeight,
|
||||
output_desc.DesktopCoordinates.bottom - output_desc.DesktopCoordinates.top);
|
||||
|
||||
|
@ -7228,7 +7228,7 @@ static void test_mode_change(IUnknown *device, BOOL is_d3d12)
|
|||
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_CURRENT_SETTINGS, &devmode2);
|
||||
ok(ret, "EnumDisplaySettingsW failed, error %#x.\n", GetLastError());
|
||||
todo_wine ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight,
|
||||
ok(devmode2.dmPelsWidth == devmode.dmPelsWidth && devmode2.dmPelsHeight == devmode.dmPelsHeight,
|
||||
"Expected resolution %ux%u, got %ux%u.\n", devmode.dmPelsWidth, devmode.dmPelsHeight,
|
||||
devmode2.dmPelsWidth, devmode2.dmPelsHeight);
|
||||
ret = EnumDisplaySettingsW(second_monitor_name, ENUM_REGISTRY_SETTINGS, &devmode2);
|
||||
|
@ -7238,10 +7238,10 @@ static void test_mode_change(IUnknown *device, BOOL is_d3d12)
|
|||
devmode2.dmPelsWidth, devmode2.dmPelsHeight);
|
||||
hr = IDXGIOutput_GetDesc(second_output, &output_desc);
|
||||
ok(hr == S_OK, "GetDesc failed, hr %#x.\n", hr);
|
||||
todo_wine ok(output_desc.DesktopCoordinates.right - output_desc.DesktopCoordinates.left ==
|
||||
ok(output_desc.DesktopCoordinates.right - output_desc.DesktopCoordinates.left ==
|
||||
devmode.dmPelsWidth, "Expected width %u, got %u.\n", devmode.dmPelsWidth,
|
||||
output_desc.DesktopCoordinates.right - output_desc.DesktopCoordinates.left);
|
||||
todo_wine ok(output_desc.DesktopCoordinates.bottom - output_desc.DesktopCoordinates.top ==
|
||||
ok(output_desc.DesktopCoordinates.bottom - output_desc.DesktopCoordinates.top ==
|
||||
devmode.dmPelsHeight, "Expected height %u, got %u.\n", devmode.dmPelsHeight,
|
||||
output_desc.DesktopCoordinates.bottom - output_desc.DesktopCoordinates.top);
|
||||
|
||||
|
|
|
@ -1320,67 +1320,155 @@ HRESULT CDECL wined3d_output_get_display_mode(const struct wined3d_output *outpu
|
|||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
static BOOL equal_display_mode(const DEVMODEW *mode1, const DEVMODEW *mode2)
|
||||
{
|
||||
if (mode1->dmFields & mode2->dmFields & DM_PELSWIDTH
|
||||
&& mode1->dmPelsWidth != mode2->dmPelsWidth)
|
||||
return FALSE;
|
||||
|
||||
if (mode1->dmFields & mode2->dmFields & DM_PELSHEIGHT
|
||||
&& mode1->dmPelsHeight != mode2->dmPelsHeight)
|
||||
return FALSE;
|
||||
|
||||
if (mode1->dmFields & mode2->dmFields & DM_BITSPERPEL
|
||||
&& mode1->dmBitsPerPel != mode2->dmBitsPerPel)
|
||||
return FALSE;
|
||||
|
||||
if (mode1->dmFields & mode2->dmFields & DM_DISPLAYFLAGS
|
||||
&& mode1->u2.dmDisplayFlags != mode2->u2.dmDisplayFlags)
|
||||
return FALSE;
|
||||
|
||||
if (mode1->dmFields & mode2->dmFields & DM_DISPLAYFREQUENCY
|
||||
&& mode1->dmDisplayFrequency != mode2->dmDisplayFrequency)
|
||||
return FALSE;
|
||||
|
||||
if (mode1->dmFields & mode2->dmFields & DM_DISPLAYORIENTATION
|
||||
&& mode1->u1.s2.dmDisplayOrientation != mode2->u1.s2.dmDisplayOrientation)
|
||||
return FALSE;
|
||||
|
||||
if (mode1->dmFields & mode2->dmFields & DM_POSITION
|
||||
&& (mode1->u1.s2.dmPosition.x != mode2->u1.s2.dmPosition.x
|
||||
|| mode1->u1.s2.dmPosition.y != mode2->u1.s2.dmPosition.y))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_restore_display_modes(struct wined3d *wined3d)
|
||||
{
|
||||
unsigned int adapter_idx, output_idx = 0;
|
||||
DEVMODEW current_mode, registry_mode;
|
||||
struct wined3d_adapter *adapter;
|
||||
DISPLAY_DEVICEW display_device;
|
||||
struct wined3d_output *output;
|
||||
BOOL do_mode_change = FALSE;
|
||||
LONG ret;
|
||||
|
||||
TRACE("wined3d %p.\n", wined3d);
|
||||
|
||||
memset(¤t_mode, 0, sizeof(current_mode));
|
||||
memset(®istry_mode, 0, sizeof(registry_mode));
|
||||
current_mode.dmSize = sizeof(current_mode);
|
||||
registry_mode.dmSize = sizeof(registry_mode);
|
||||
display_device.cb = sizeof(display_device);
|
||||
while (EnumDisplayDevicesW(NULL, output_idx++, &display_device, 0))
|
||||
{
|
||||
if (!EnumDisplaySettingsExW(display_device.DeviceName, ENUM_CURRENT_SETTINGS, ¤t_mode, 0))
|
||||
{
|
||||
ERR("Failed to read the current display mode for %s.\n",
|
||||
wine_dbgstr_w(display_device.DeviceName));
|
||||
return WINED3DERR_NOTAVAILABLE;
|
||||
}
|
||||
|
||||
if (!EnumDisplaySettingsExW(display_device.DeviceName, ENUM_REGISTRY_SETTINGS, ®istry_mode, 0))
|
||||
{
|
||||
ERR("Failed to read the registry display mode for %s.\n",
|
||||
wine_dbgstr_w(display_device.DeviceName));
|
||||
return WINED3DERR_NOTAVAILABLE;
|
||||
}
|
||||
|
||||
if (!equal_display_mode(¤t_mode, ®istry_mode))
|
||||
{
|
||||
do_mode_change = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (do_mode_change)
|
||||
{
|
||||
ret = ChangeDisplaySettingsExW(NULL, NULL, NULL, 0, NULL);
|
||||
if (ret != DISP_CHANGE_SUCCESSFUL)
|
||||
{
|
||||
ERR("Failed to restore all outputs to their registry display settings, error %d.\n", ret);
|
||||
return WINED3DERR_NOTAVAILABLE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE("Skipping redundant mode setting call.\n");
|
||||
}
|
||||
|
||||
for (adapter_idx = 0; adapter_idx < wined3d->adapter_count; ++adapter_idx)
|
||||
{
|
||||
adapter = wined3d->adapters[adapter_idx];
|
||||
for (output_idx = 0; output_idx < adapter->output_count; ++output_idx)
|
||||
{
|
||||
output = &adapter->outputs[output_idx];
|
||||
|
||||
if (!EnumDisplaySettingsExW(output->device_name, ENUM_CURRENT_SETTINGS, ¤t_mode, 0))
|
||||
{
|
||||
ERR("Failed to read the current display mode for %s.\n",
|
||||
wine_dbgstr_w(output->device_name));
|
||||
return WINED3DERR_NOTAVAILABLE;
|
||||
}
|
||||
|
||||
output->screen_format = pixelformat_for_depth(current_mode.dmBitsPerPel);
|
||||
}
|
||||
}
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
HRESULT CDECL wined3d_output_set_display_mode(struct wined3d_output *output,
|
||||
const struct wined3d_display_mode *mode)
|
||||
{
|
||||
enum wined3d_format_id new_format_id;
|
||||
const struct wined3d_format *format;
|
||||
DEVMODEW new_mode, current_mode;
|
||||
LONG ret;
|
||||
enum wined3d_format_id new_format_id;
|
||||
|
||||
TRACE("output %p, mode %p.\n", output, mode);
|
||||
TRACE("mode %ux%u@%u %s %#x.\n", mode->width, mode->height, mode->refresh_rate,
|
||||
debug_d3dformat(mode->format_id), mode->scanline_ordering);
|
||||
|
||||
memset(&new_mode, 0, sizeof(new_mode));
|
||||
new_mode.dmSize = sizeof(new_mode);
|
||||
memset(¤t_mode, 0, sizeof(current_mode));
|
||||
current_mode.dmSize = sizeof(current_mode);
|
||||
if (mode)
|
||||
|
||||
format = wined3d_get_format(output->adapter, mode->format_id, WINED3D_BIND_RENDER_TARGET);
|
||||
|
||||
new_mode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
|
||||
new_mode.dmBitsPerPel = format->byte_count * CHAR_BIT;
|
||||
new_mode.dmPelsWidth = mode->width;
|
||||
new_mode.dmPelsHeight = mode->height;
|
||||
new_mode.dmDisplayFrequency = mode->refresh_rate;
|
||||
if (mode->refresh_rate)
|
||||
new_mode.dmFields |= DM_DISPLAYFREQUENCY;
|
||||
if (mode->scanline_ordering != WINED3D_SCANLINE_ORDERING_UNKNOWN)
|
||||
{
|
||||
const struct wined3d_format *format;
|
||||
|
||||
TRACE("mode %ux%u@%u %s %#x.\n", mode->width, mode->height, mode->refresh_rate,
|
||||
debug_d3dformat(mode->format_id), mode->scanline_ordering);
|
||||
|
||||
format = wined3d_get_format(output->adapter, mode->format_id, WINED3D_BIND_RENDER_TARGET);
|
||||
|
||||
new_mode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
|
||||
new_mode.dmBitsPerPel = format->byte_count * CHAR_BIT;
|
||||
new_mode.dmPelsWidth = mode->width;
|
||||
new_mode.dmPelsHeight = mode->height;
|
||||
|
||||
new_mode.dmDisplayFrequency = mode->refresh_rate;
|
||||
if (mode->refresh_rate)
|
||||
new_mode.dmFields |= DM_DISPLAYFREQUENCY;
|
||||
|
||||
if (mode->scanline_ordering != WINED3D_SCANLINE_ORDERING_UNKNOWN)
|
||||
{
|
||||
new_mode.dmFields |= DM_DISPLAYFLAGS;
|
||||
if (mode->scanline_ordering == WINED3D_SCANLINE_ORDERING_INTERLACED)
|
||||
new_mode.u2.dmDisplayFlags |= DM_INTERLACED;
|
||||
}
|
||||
new_format_id = mode->format_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!EnumDisplaySettingsW(output->device_name, ENUM_REGISTRY_SETTINGS, &new_mode))
|
||||
{
|
||||
ERR("Failed to read mode from registry.\n");
|
||||
return WINED3DERR_NOTAVAILABLE;
|
||||
}
|
||||
new_format_id = pixelformat_for_depth(new_mode.dmBitsPerPel);
|
||||
new_mode.dmFields |= DM_DISPLAYFLAGS;
|
||||
if (mode->scanline_ordering == WINED3D_SCANLINE_ORDERING_INTERLACED)
|
||||
new_mode.u2.dmDisplayFlags |= DM_INTERLACED;
|
||||
}
|
||||
new_format_id = mode->format_id;
|
||||
|
||||
/* Only change the mode if necessary. */
|
||||
if (!EnumDisplaySettingsW(output->device_name, ENUM_CURRENT_SETTINGS, ¤t_mode))
|
||||
{
|
||||
ERR("Failed to get current display mode.\n");
|
||||
}
|
||||
else if (current_mode.dmPelsWidth == new_mode.dmPelsWidth
|
||||
&& current_mode.dmPelsHeight == new_mode.dmPelsHeight
|
||||
&& current_mode.dmBitsPerPel == new_mode.dmBitsPerPel
|
||||
&& (current_mode.dmDisplayFrequency == new_mode.dmDisplayFrequency
|
||||
|| !(new_mode.dmFields & DM_DISPLAYFREQUENCY))
|
||||
&& (current_mode.u2.dmDisplayFlags == new_mode.u2.dmDisplayFlags
|
||||
|| !(new_mode.dmFields & DM_DISPLAYFLAGS)))
|
||||
else if (equal_display_mode(¤t_mode, &new_mode))
|
||||
{
|
||||
TRACE("Skipping redundant mode setting call.\n");
|
||||
output->screen_format = new_format_id;
|
||||
|
|
|
@ -28,8 +28,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
|||
|
||||
void wined3d_swapchain_cleanup(struct wined3d_swapchain *swapchain)
|
||||
{
|
||||
struct wined3d_output *output;
|
||||
HRESULT hr = E_FAIL;
|
||||
HRESULT hr;
|
||||
UINT i;
|
||||
|
||||
TRACE("Destroying swapchain %p.\n", swapchain);
|
||||
|
@ -71,9 +70,7 @@ void wined3d_swapchain_cleanup(struct wined3d_swapchain *swapchain)
|
|||
{
|
||||
if (swapchain->state.desc.auto_restore_display_mode)
|
||||
{
|
||||
output = wined3d_swapchain_get_output(swapchain);
|
||||
if (!output || FAILED(hr = wined3d_output_set_display_mode(output,
|
||||
&swapchain->state.original_mode)))
|
||||
if (FAILED(hr = wined3d_restore_display_modes(swapchain->device->wined3d)))
|
||||
ERR("Failed to restore display mode, hr %#x.\n", hr);
|
||||
|
||||
if (swapchain->state.desc.flags & WINED3D_SWAPCHAIN_RESTORE_WINDOW_RECT)
|
||||
|
@ -1543,8 +1540,7 @@ static HRESULT wined3d_swapchain_init(struct wined3d_swapchain *swapchain, struc
|
|||
err:
|
||||
if (displaymode_set)
|
||||
{
|
||||
if (FAILED(wined3d_output_set_display_mode(desc->output,
|
||||
&swapchain->state.original_mode)))
|
||||
if (FAILED(wined3d_restore_display_modes(device->wined3d)))
|
||||
ERR("Failed to restore display mode.\n");
|
||||
}
|
||||
|
||||
|
@ -1791,13 +1787,6 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa
|
|||
if (!(focus_messages = device->wined3d->flags & WINED3D_FOCUS_MESSAGES))
|
||||
filter = wined3d_filter_messages(window, TRUE);
|
||||
|
||||
output = wined3d_swapchain_get_output(swapchain);
|
||||
if (!output)
|
||||
{
|
||||
ERR("Failed to get output from swapchain %p.\n", swapchain);
|
||||
return;
|
||||
}
|
||||
|
||||
if (activate)
|
||||
{
|
||||
SystemParametersInfoW(SPI_GETSCREENSAVEACTIVE, 0, &screensaver_active, 0);
|
||||
|
@ -1813,6 +1802,13 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa
|
|||
*
|
||||
* Guild Wars 1 wants a WINDOWPOSCHANGED message on the device window to
|
||||
* resume drawing after a focus loss. */
|
||||
output = wined3d_swapchain_get_output(swapchain);
|
||||
if (!output)
|
||||
{
|
||||
ERR("Failed to get output from swapchain %p.\n", swapchain);
|
||||
return;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr = wined3d_output_get_desc(output, &output_desc)))
|
||||
SetWindowPos(window, NULL, output_desc.desktop_rect.left,
|
||||
output_desc.desktop_rect.top, swapchain->state.desc.backbuffer_width,
|
||||
|
@ -1823,6 +1819,13 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa
|
|||
|
||||
if (device->wined3d->flags & WINED3D_RESTORE_MODE_ON_ACTIVATE)
|
||||
{
|
||||
output = wined3d_swapchain_get_output(swapchain);
|
||||
if (!output)
|
||||
{
|
||||
ERR("Failed to get output from swapchain %p.\n", swapchain);
|
||||
return;
|
||||
}
|
||||
|
||||
if (FAILED(hr = wined3d_output_set_display_mode(output,
|
||||
&swapchain->state.d3d_mode)))
|
||||
ERR("Failed to set display mode, hr %#x.\n", hr);
|
||||
|
@ -1839,8 +1842,8 @@ void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activa
|
|||
device->restore_screensaver = FALSE;
|
||||
}
|
||||
|
||||
if (FAILED(hr = wined3d_output_set_display_mode(output, NULL)))
|
||||
ERR("Failed to set display mode, hr %#x.\n", hr);
|
||||
if (FAILED(hr = wined3d_restore_display_modes(device->wined3d)))
|
||||
ERR("Failed to restore display modes, hr %#x.\n", hr);
|
||||
|
||||
swapchain->reapply_mode = TRUE;
|
||||
|
||||
|
@ -1974,9 +1977,9 @@ static HRESULT wined3d_swapchain_state_set_display_mode(struct wined3d_swapchain
|
|||
|
||||
if (output != state->desc.output)
|
||||
{
|
||||
if (FAILED(hr = wined3d_output_set_display_mode(state->desc.output, &state->original_mode)))
|
||||
if (FAILED(hr = wined3d_restore_display_modes(state->wined3d)))
|
||||
{
|
||||
WARN("Failed to set display mode, hr %#x.\n", hr);
|
||||
WARN("Failed to restore display modes, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
@ -2199,6 +2202,9 @@ HRESULT CDECL wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_st
|
|||
if (mode)
|
||||
{
|
||||
actual_mode = *mode;
|
||||
if (FAILED(hr = wined3d_swapchain_state_set_display_mode(state, swapchain_desc->output,
|
||||
&actual_mode)))
|
||||
return hr;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2210,16 +2216,19 @@ HRESULT CDECL wined3d_swapchain_state_set_fullscreen(struct wined3d_swapchain_st
|
|||
actual_mode.format_id = adapter_format_from_backbuffer_format(swapchain_desc->output->adapter,
|
||||
swapchain_desc->backbuffer_format);
|
||||
actual_mode.scanline_ordering = WINED3D_SCANLINE_ORDERING_UNKNOWN;
|
||||
if (FAILED(hr = wined3d_swapchain_state_set_display_mode(state, swapchain_desc->output,
|
||||
&actual_mode)))
|
||||
return hr;
|
||||
}
|
||||
else
|
||||
{
|
||||
actual_mode = state->original_mode;
|
||||
if (FAILED(hr = wined3d_restore_display_modes(state->wined3d)))
|
||||
{
|
||||
WARN("Failed to restore display modes for all outputs, hr %#x.\n", hr);
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (FAILED(hr = wined3d_swapchain_state_set_display_mode(state, swapchain_desc->output,
|
||||
&actual_mode)))
|
||||
return hr;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
@ cdecl wined3d_incref(ptr)
|
||||
@ cdecl wined3d_register_software_device(ptr ptr)
|
||||
@ cdecl wined3d_register_window(ptr ptr ptr long)
|
||||
@ cdecl wined3d_restore_display_modes(ptr)
|
||||
@ cdecl wined3d_unregister_windows(ptr)
|
||||
|
||||
@ cdecl wined3d_adapter_get_identifier(ptr long ptr)
|
||||
|
|
|
@ -2313,6 +2313,7 @@ ULONG __cdecl wined3d_incref(struct wined3d *wined3d);
|
|||
HRESULT __cdecl wined3d_register_software_device(struct wined3d *wined3d, void *init_function);
|
||||
BOOL __cdecl wined3d_register_window(struct wined3d *wined3d, HWND window,
|
||||
struct wined3d_device *device, unsigned int flags);
|
||||
HRESULT __cdecl wined3d_restore_display_modes(struct wined3d *wined3d);
|
||||
void __cdecl wined3d_unregister_windows(struct wined3d *wined3d);
|
||||
|
||||
HRESULT __cdecl wined3d_adapter_get_identifier(const struct wined3d_adapter *adapter,
|
||||
|
|
Loading…
Reference in New Issue