Fixed: #1045 XMapWindow doesn't preserve current window position

This commit is contained in:
kervala 2010-08-01 09:24:10 +02:00
parent 8165f61ac3
commit 048e0da233
2 changed files with 9 additions and 2 deletions

View file

@ -674,6 +674,7 @@ private:
bool _Resizable; bool _Resizable;
uint _Interval; uint _Interval;
sint8 _AntiAliasing; sint8 _AntiAliasing;
bool _WindowVisible;
uint32 _WindowWidth, _WindowHeight; uint32 _WindowWidth, _WindowHeight;
sint32 _WindowX, _WindowY; sint32 _WindowX, _WindowY;

View file

@ -493,6 +493,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
_win = EmptyWindow; _win = EmptyWindow;
_WindowWidth = _WindowHeight = _WindowX = _WindowY = 0; _WindowWidth = _WindowHeight = _WindowX = _WindowY = 0;
_WindowVisible = false;
_FullScreen = false; _FullScreen = false;
_Resizable = resizeable; _Resizable = resizeable;
_OffScreen = mode.OffScreen; _OffScreen = mode.OffScreen;
@ -1828,6 +1829,8 @@ void CDriverGL::showWindow(bool show)
if (_win == EmptyWindow || !_DestroyWindow) if (_win == EmptyWindow || !_DestroyWindow)
return; return;
_WindowVisible = show;
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
ShowWindow (_win, show ? SW_SHOW:SW_HIDE); ShowWindow (_win, show ? SW_SHOW:SW_HIDE);
#elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE) #elif defined(NL_OS_MAC) && defined(NL_MAC_NATIVE)
@ -1838,8 +1841,11 @@ void CDriverGL::showWindow(bool show)
if (show) if (show)
{ {
XMapWindow(_dpy, _win); // XMapWindow(_dpy, _win);
// XMapRaised(_dpy, _win); XMapRaised(_dpy, _win);
// fix window position if windows manager want to impose them
setWindowPos(_WindowX, _WindowY);
} }
else else
{ {