[PATCH 2/5] wined3d: Restore display mode for the previous output before changing to another output.

Zhiyi Zhang zzhang at codeweavers.com
Fri May 15 02:46:04 CDT 2020


Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
---
 dlls/wined3d/swapchain.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 21e9ec459eb..a4929b7a5b9 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);
-- 
2.25.1




More information about the wine-devel mailing list