From dc26ec8b37223e483f0fe7425a38dfee34751e88 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 19 Nov 2010 11:19:53 +0100 Subject: [PATCH] Changed: #1198 Window is too large when switching from fullscreen to windowed mode --- code/nel/src/3d/driver/opengl/driver_opengl_window.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index 44de79891..79f510cfa 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -1777,12 +1777,16 @@ bool CDriverGL::setMode(const GfxMode& mode) if (!setScreenMode(mode)) return false; + // change window size before changing style for some cases + setWindowSize(mode.Width, mode.Height); + // when changing window style, it's possible system change window size too setWindowStyle(mode.Windowed ? EWSWindowed : EWSFullscreen); if (!mode.Windowed) _Depth = mode.Depth; + // to be sure window size is correct after changing style setWindowSize(mode.Width, mode.Height); setWindowPos(_WindowX, _WindowY);