mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-21 08:28:44 +00:00
Changed: Minor changes for X implementations
This commit is contained in:
parent
e5b16b911b
commit
80e31822b6
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)
|
||||
|
||||
if (!_FullScreen)
|
||||
{
|
||||
// first time requesting decoration sizes
|
||||
if (_WindowX && _WindowY && !_DecorationWidth && !_DecorationHeight && _WndActive)
|
||||
{
|
||||
|
@ -2237,6 +2239,7 @@ void CDriverGL::setWindowPos(sint32 x, sint32 y)
|
|||
}
|
||||
|
||||
XMoveWindow(_dpy, _win, x, y);
|
||||
}
|
||||
|
||||
#endif // NL_OS_WINDOWS
|
||||
}
|
||||
|
@ -2459,7 +2462,26 @@ void CDriverGL::setWindowSize(uint32 width, uint32 height)
|
|||
|
||||
#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
|
||||
XResizeWindow(_dpy, _win, width, height);
|
||||
|
@ -2468,21 +2490,6 @@ void CDriverGL::setWindowSize(uint32 width, uint32 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
|
||||
}
|
||||
|
||||
|
@ -2496,13 +2503,10 @@ void CDriverGL::getWindowPos(sint32 &x, sint32 &y)
|
|||
x = y = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_win)
|
||||
{
|
||||
x = _WindowX;
|
||||
y = _WindowY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue