dxgi: Update swapchain fullscreen state when state change is successful.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2016-08-28 22:30:53 +02:00 committed by Alexandre Julliard
parent 35537b1d45
commit 7c5f60f2d8
1 changed files with 12 additions and 5 deletions

View File

@ -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_mutex_lock();
wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &swapchain_desc); wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &swapchain_desc);
swapchain_desc.windowed = !fullscreen; swapchain_desc.windowed = !fullscreen;
hr = wined3d_swapchain_set_fullscreen(swapchain->wined3d_swapchain, &swapchain_desc, NULL); hr = wined3d_swapchain_set_fullscreen(swapchain->wined3d_swapchain, &swapchain_desc, NULL);
wined3d_mutex_unlock(); 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; return hr;
} }