[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
1 changed files with 11 additions and 1 deletions

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());