From a3c561f9dc079b899993a7fb1d95f3b02af1b3ba Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sun, 29 Apr 2018 17:26:00 +0200 Subject: [PATCH] [dxgi] LeaveFullscreenMode: Correctly restore the window size --- src/dxgi/dxgi_swapchain.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dxgi/dxgi_swapchain.cpp b/src/dxgi/dxgi_swapchain.cpp index b8be1798..92aec639 100644 --- a/src/dxgi/dxgi_swapchain.cpp +++ b/src/dxgi/dxgi_swapchain.cpp @@ -454,6 +454,11 @@ namespace dxvk { rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOACTIVATE); + // For some reason we have to call SetWindowPos again, or + // otherwise the window size is not going to be applied. + ::SetWindowPos(m_desc.OutputWindow, 0, 0, 0, 0, 0, + SWP_NOSENDCHANGING | SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); + return SetDefaultGammaControl(); }