Fixed: #1045 XMapWindow doesn't preserve current window position
This commit is contained in:
parent
754b997282
commit
33613b8cec
2 changed files with 9 additions and 2 deletions
|
@ -674,6 +674,7 @@ private:
|
|||
bool _Resizable;
|
||||
uint _Interval;
|
||||
sint8 _AntiAliasing;
|
||||
bool _WindowVisible;
|
||||
|
||||
uint32 _WindowWidth, _WindowHeight;
|
||||
sint32 _WindowX, _WindowY;
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue