Andrew Eikum : dxgi: Return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE if setting the fullscreen state failed.

Alexandre Julliard julliard at winehq.org
Thu Jun 20 16:04:14 CDT 2019


Module: wine
Branch: master
Commit: 45166d33136c93ac29cb97400f6260683c711df5
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=45166d33136c93ac29cb97400f6260683c711df5

Author: Andrew Eikum <aeikum at codeweavers.com>
Date:   Thu Jun 20 02:47:47 2019 +0430

dxgi: Return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE if setting the fullscreen state failed.

Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dxgi/swapchain.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c
index 030bb67..4f01d9c 100644
--- a/dlls/dxgi/swapchain.c
+++ b/dlls/dxgi/swapchain.c
@@ -385,18 +385,18 @@ static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d11_swapchain_SetFullscreen
     swapchain_desc.windowed = !fullscreen;
     hr = wined3d_swapchain_set_fullscreen(swapchain->wined3d_swapchain, &swapchain_desc, NULL);
     wined3d_mutex_unlock();
-
-    if (SUCCEEDED(hr))
+    if (FAILED(hr))
     {
-        if (swapchain->target)
-            IDXGIOutput_Release(swapchain->target);
-        swapchain->target = target;
-        return S_OK;
+        if (target)
+            IDXGIOutput_Release(target);
+        return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE;
     }
 
-    if (target)
-        IDXGIOutput_Release(target);
-    return hr;
+    if (swapchain->target)
+        IDXGIOutput_Release(swapchain->target);
+    swapchain->target = target;
+
+    return S_OK;
 }
 
 static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFullscreenState(IDXGISwapChain1 *iface,




More information about the wine-cvs mailing list