From dd93616bf67c61691bebd494f25598fb5d6d98fb Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 1 Aug 2010 09:24:10 +0200 Subject: [PATCH] Fixed: #1045 XMapWindow doesn't preserve current window position --- code/nel/src/3d/driver/opengl/driver_opengl.h | 1 + code/nel/src/3d/driver/opengl/driver_opengl_window.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl.h b/code/nel/src/3d/driver/opengl/driver_opengl.h index 33c02f69a..c4ed12412 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl.h +++ b/code/nel/src/3d/driver/opengl/driver_opengl.h @@ -674,6 +674,7 @@ private: bool _Resizable; uint _Interval; sint8 _AntiAliasing; + bool _WindowVisible; uint32 _WindowWidth, _WindowHeight; sint32 _WindowX, _WindowY; 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 ab77ba4a9..ff08d7e27 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -493,6 +493,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re _win = EmptyWindow; _WindowWidth = _WindowHeight = _WindowX = _WindowY = 0; + _WindowVisible = false; _FullScreen = false; _Resizable = resizeable; _OffScreen = mode.OffScreen; @@ -1828,6 +1829,8 @@ void CDriverGL::showWindow(bool show) if (_win == EmptyWindow || !_DestroyWindow) return; + _WindowVisible = show; + #ifdef NL_OS_WINDOWS ShowWindow (_win, show ? SW_SHOW:SW_HIDE); #elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE) @@ -1838,8 +1841,11 @@ void CDriverGL::showWindow(bool show) if (show) { - XMapWindow(_dpy, _win); -// XMapRaised(_dpy, _win); +// XMapWindow(_dpy, _win); + XMapRaised(_dpy, _win); + + // fix window position if windows manager want to impose them + setWindowPos(_WindowX, _WindowY); } else {