1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-05 01:24:14 +01:00

[dxgi] Leave current fullscreen mode when SetFullscreenState changes monitors

This fixes RiME not moving its window when output display is
changed in the game settings.
This commit is contained in:
Rémi Bernon 2023-04-07 09:59:49 +02:00 committed by Philip Rebohle
parent 01dc9ddc7d
commit 0cf563d5df

View File

@ -425,8 +425,18 @@ namespace dxvk {
Com<IDXGIOutput1> target;
if (pTarget)
if (pTarget) {
DXGI_OUTPUT_DESC desc;
pTarget->QueryInterface(IID_PPV_ARGS(&target));
target->GetDesc(&desc);
if (!m_descFs.Windowed && Fullscreen && m_monitor != desc.Monitor) {
HRESULT hr = this->LeaveFullscreenMode();
if (FAILED(hr))
return hr;
}
}
if (m_descFs.Windowed && Fullscreen)
return this->EnterFullscreenMode(target.ptr());