From e589314f89c5004f960152c0b59b887a3df842e5 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Sun, 17 Jun 2012 00:38:07 +0200 Subject: [PATCH] Avoid truncated window size after going from fullscreen to a window of the same size. Must set the window size after the display resolution, otherwise Windows may clamp it to a smaller size than specified. --- Sources/Plasma/Apps/plClient/plClient.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/Apps/plClient/plClient.cpp b/Sources/Plasma/Apps/plClient/plClient.cpp index c4edea69..77c35bcb 100644 --- a/Sources/Plasma/Apps/plClient/plClient.cpp +++ b/Sources/Plasma/Apps/plClient/plClient.cpp @@ -2181,10 +2181,10 @@ void plClient::ResetDisplayDevice(int Width, int Height, int ColorDepth, hsBool WindowActivate(false); - ResizeDisplayDevice(Width, Height, Windowed); - fPipeline->ResetDisplayDevice(Width, Height, ColorDepth, Windowed, NumAASamples, MaxAnisotropicSamples, VSync); + ResizeDisplayDevice(Width, Height, Windowed); + WindowActivate(true); } @@ -2202,7 +2202,8 @@ void plClient::ResizeDisplayDevice(int Width, int Height, hsBool Windowed) uint32_t winStyle, winExStyle; if( Windowed ) { - winStyle = WS_OVERLAPPEDWINDOW; + // WS_VISIBLE appears necessary to avoid leaving behind framebuffer junk when going from windowed to a smaller window + winStyle = WS_OVERLAPPEDWINDOW | WS_VISIBLE; winExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE; } else { winStyle = WS_POPUP;