1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-18 13:54:16 +01:00

[dxgi] SetFullscreenState succeeds if not changing state

This fixes an error dialog on exiting Unreal Engine 4 games.
This commit is contained in:
Andrew Eikum 2018-08-13 09:50:36 -05:00 committed by Philip Rebohle
parent a12b3cc5a0
commit 262797f9d5

View File

@ -410,9 +410,6 @@ namespace dxvk {
IDXGIOutput* pTarget) {
std::lock_guard<std::mutex> lock(m_lockWindow);
if (!IsWindow(m_window))
return DXGI_ERROR_INVALID_CALL;
if (m_descFs.Windowed && Fullscreen)
return this->EnterFullscreenMode(pTarget);
else if (!m_descFs.Windowed && !Fullscreen)
@ -522,6 +519,9 @@ namespace dxvk {
HRESULT DxgiSwapChain::EnterFullscreenMode(IDXGIOutput* pTarget) {
Com<IDXGIOutput> output = static_cast<DxgiOutput*>(pTarget);
if (!IsWindow(m_window))
return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE;
if (output == nullptr) {
if (FAILED(GetContainingOutput(&output))) {
@ -581,6 +581,9 @@ namespace dxvk {
HRESULT DxgiSwapChain::LeaveFullscreenMode() {
Com<IDXGIOutput> output;
if (!IsWindow(m_window))
return DXGI_ERROR_NOT_CURRENTLY_AVAILABLE;
if (FAILED(m_adapter->GetOutputFromMonitor(m_monitor, &output))
|| FAILED(RestoreDisplayMode(output.ptr())))