Zhiyi Zhang : wined3d: Restore display mode for the previous output before changing to another output.
Module: wine Branch: master Commit: b6495fa31d164d376cd6b7dc8247d0b2009853af URL: https://source.winehq.org/git/wine.git/?a=commit;h=b6495fa31d164d376cd6b7dc8... Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Fri May 15 15:46:04 2020 +0800 wined3d: Restore display mode for the previous output before changing to another output. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/swapchain.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 21e9ec459e..a4929b7a5b 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -1434,6 +1434,21 @@ 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))) + { + WARN("Failed to set display mode, hr %#x.\n", hr); + return hr; + } + + if (FAILED(hr = wined3d_output_get_display_mode(output, &state->original_mode, NULL))) + { + WARN("Failed to get current display mode, hr %#x.\n", hr); + return hr; + } + } + if (FAILED(hr = wined3d_output_set_display_mode(output, mode))) { WARN("Failed to set display mode, hr %#x.\n", hr);
participants (1)
-
Alexandre Julliard