[PATCH 1/2] dxgi: Update swapchain fullscreen state when state change is successful.

Józef Kucia jkucia at codeweavers.com
Sun Aug 28 15:30:53 CDT 2016


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/dxgi/swapchain.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c
index 7b02b3e..a759885 100644
--- a/dlls/dxgi/swapchain.c
+++ b/dlls/dxgi/swapchain.c
@@ -229,17 +229,24 @@ static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH dxgi_swapchain_SetFullscreenS
         }
     }
 
-    swapchain->fullscreen = fullscreen;
-    if (swapchain->target)
-        IDXGIOutput_Release(swapchain->target);
-    swapchain->target = target;
-
     wined3d_mutex_lock();
     wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &swapchain_desc);
     swapchain_desc.windowed = !fullscreen;
     hr = wined3d_swapchain_set_fullscreen(swapchain->wined3d_swapchain, &swapchain_desc, NULL);
     wined3d_mutex_unlock();
 
+    if (SUCCEEDED(hr))
+    {
+        swapchain->fullscreen = fullscreen;
+        if (swapchain->target)
+            IDXGIOutput_Release(swapchain->target);
+        swapchain->target = target;
+    }
+    else
+    {
+        IDXGIOutput_Release(target);
+    }
+
     return hr;
 }
 
-- 
2.7.3




More information about the wine-patches mailing list