mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-29 15:16:05 +00:00
Changed: Minor changes for X implementations
This commit is contained in:
parent
e3d2c8ce98
commit
9812afcd17
1 changed files with 31 additions and 27 deletions
|
@ -2229,6 +2229,8 @@ void CDriverGL::setWindowPos(sint32 x, sint32 y)
|
||||||
|
|
||||||
#elif defined (NL_OS_UNIX)
|
#elif defined (NL_OS_UNIX)
|
||||||
|
|
||||||
|
if (!_FullScreen)
|
||||||
|
{
|
||||||
// first time requesting decoration sizes
|
// first time requesting decoration sizes
|
||||||
if (_WindowX && _WindowY && !_DecorationWidth && !_DecorationHeight && _WndActive)
|
if (_WindowX && _WindowY && !_DecorationWidth && !_DecorationHeight && _WndActive)
|
||||||
{
|
{
|
||||||
|
@ -2237,6 +2239,7 @@ void CDriverGL::setWindowPos(sint32 x, sint32 y)
|
||||||
}
|
}
|
||||||
|
|
||||||
XMoveWindow(_dpy, _win, x, y);
|
XMoveWindow(_dpy, _win, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
#endif // NL_OS_WINDOWS
|
#endif // NL_OS_WINDOWS
|
||||||
}
|
}
|
||||||
|
@ -2459,7 +2462,26 @@ void CDriverGL::setWindowSize(uint32 width, uint32 height)
|
||||||
|
|
||||||
#elif defined(NL_OS_UNIX)
|
#elif defined(NL_OS_UNIX)
|
||||||
|
|
||||||
if (width != _WindowWidth || height != _WindowHeight)
|
if (!_Resizable)
|
||||||
|
{
|
||||||
|
// Update WM hints (disallow resizing)
|
||||||
|
XSizeHints *size_hints = XAllocSizeHints();
|
||||||
|
|
||||||
|
size_hints->flags = PMinSize | PMaxSize;
|
||||||
|
size_hints->min_width = width;
|
||||||
|
size_hints->min_height = height;
|
||||||
|
size_hints->max_width = width;
|
||||||
|
size_hints->max_height = height;
|
||||||
|
|
||||||
|
XSetWMNormalHints(_dpy, _win, size_hints);
|
||||||
|
XFree(size_hints);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
XSetWMNormalHints(_dpy, _win, StdHints);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (width != _CurrentMode.Width || height != _CurrentMode.Height)
|
||||||
{
|
{
|
||||||
// resize the window
|
// resize the window
|
||||||
XResizeWindow(_dpy, _win, width, height);
|
XResizeWindow(_dpy, _win, width, height);
|
||||||
|
@ -2468,21 +2490,6 @@ void CDriverGL::setWindowSize(uint32 width, uint32 height)
|
||||||
_CurrentMode.Height = height;
|
_CurrentMode.Height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update WM hints (allow resizing)
|
|
||||||
XSizeHints size_hints;
|
|
||||||
size_hints.flags = 0;
|
|
||||||
|
|
||||||
if (!_Resizable || _FullScreen)
|
|
||||||
{
|
|
||||||
size_hints.flags |= PMinSize | PMaxSize;
|
|
||||||
size_hints.min_width = width;
|
|
||||||
size_hints.min_height = height;
|
|
||||||
size_hints.max_width = width;
|
|
||||||
size_hints.max_height = height;
|
|
||||||
}
|
|
||||||
|
|
||||||
XSetWMNormalHints(_dpy, _win, &size_hints);
|
|
||||||
|
|
||||||
#endif // NL_OS_WINDOWS
|
#endif // NL_OS_WINDOWS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2496,14 +2503,11 @@ void CDriverGL::getWindowPos(sint32 &x, sint32 &y)
|
||||||
x = y = 0;
|
x = y = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
if (_win)
|
|
||||||
{
|
{
|
||||||
x = _WindowX;
|
x = _WindowX;
|
||||||
y = _WindowY;
|
y = _WindowY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
bool CDriverGL::isActive()
|
bool CDriverGL::isActive()
|
||||||
|
|
Loading…
Reference in a new issue