From 45166d33136c93ac29cb97400f6260683c711df5 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Thu, 20 Jun 2019 02:29:47 +0430 Subject: [PATCH] dxgi: Return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE if setting the fullscreen state failed. Signed-off-by: Andrew Eikum Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- 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 030bb67c22d..4f01d9ce024 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,