Skip to content

Commit e5ca79b

Browse files
Matteo Brunidoitsujin
authored andcommitted
[dxgi] Update saved window state on ResizeTarget
1 parent faae3ed commit e5ca79b

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/dxgi/dxgi_swapchain.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,12 +491,23 @@ namespace dxvk {
491491
Logger::err("DXGI: ResizeTarget: Failed to query containing output");
492492
return E_FAIL;
493493
}
494-
495-
ChangeDisplayMode(output.ptr(), &newDisplayMode);
496494

495+
RECT bounds = { };
496+
wsi::getDesktopCoordinates(m_monitor, &bounds);
497+
498+
uint32_t width = 0u;
499+
uint32_t height = 0u;
500+
501+
wsi::getWindowSize(m_window, &width, &height);
502+
503+
// Window bounds were changed behind our back, update saved state
504+
if (uint32_t(bounds.right - bounds.left) != width || uint32_t(bounds.bottom - bounds.top) != height)
505+
wsi::saveWindowState(m_window, &m_windowState, false);
506+
507+
ChangeDisplayMode(output.ptr(), &newDisplayMode);
497508
wsi::updateFullscreenWindow(m_monitor, m_window, false);
498509
}
499-
510+
500511
return S_OK;
501512
}
502513

0 commit comments

Comments
 (0)