mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +01:00
[dxgi] Fix SetFullscreenState behaviour with invalid usage
Fixes various wine test failures.
This commit is contained in:
parent
60ff2b8977
commit
f58c1c2d1d
@ -382,6 +382,9 @@ namespace dxvk {
|
||||
IDXGIOutput* pTarget) {
|
||||
std::lock_guard<std::recursive_mutex> lock(m_lockWindow);
|
||||
|
||||
if (!Fullscreen && pTarget)
|
||||
return DXGI_ERROR_INVALID_CALL;
|
||||
|
||||
if (m_descFs.Windowed && Fullscreen)
|
||||
return this->EnterFullscreenMode(pTarget);
|
||||
else if (!m_descFs.Windowed && !Fullscreen)
|
||||
@ -610,9 +613,6 @@ namespace dxvk {
|
||||
|
||||
|
||||
HRESULT DxgiSwapChain::LeaveFullscreenMode() {
|
||||
if (!IsWindow(m_window))
|
||||
return S_OK;
|
||||
|
||||
if (FAILED(RestoreDisplayMode(m_monitor)))
|
||||
Logger::warn("DXGI: LeaveFullscreenMode: Failed to restore display mode");
|
||||
|
||||
@ -632,6 +632,9 @@ namespace dxvk {
|
||||
m_monitor = nullptr;
|
||||
m_target = nullptr;
|
||||
|
||||
if (!IsWindow(m_window))
|
||||
return S_OK;
|
||||
|
||||
// Only restore the window style if the application hasn't
|
||||
// changed them. This is in line with what native DXGI does.
|
||||
LONG curStyle = ::GetWindowLongW(m_window, GWL_STYLE) & ~WS_VISIBLE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user