EXP-1580 FIXED applying "MinWindowWidth" and "MinWindowHeight" settings to Linux viewer window.

Added minimum size setting method for X11 viewer window on Linux.
master
Seth ProductEngine 2011-11-30 01:01:22 +02:00
parent adeb71d982
commit 1a7e49ece8
2 changed files with 20 additions and 23 deletions

View File

@ -179,20 +179,6 @@ Display* LLWindowSDL::get_SDL_Display(void)
}
return NULL;
}
void LLWindowSDL::setXWindowMinSize()
{
// Set the minimum size limits for X11 window
// so the window manager doesn't allow resizing below those limits.
XSizeHints* hints = XAllocSizeHints();
hints->flags |= PMinSize;
hints->min_width = mMinWindowWidth;
hints->min_height = mMinWindowHeight;
XSetWMNormalHints(mSDL_Display, mSDL_XWindowID, hints);
XFree(hints);
}
#endif // LL_X11
@ -752,8 +738,6 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
mSDL_XWindowID = info.info.x11.wmwindow;
Lock_Display = info.info.x11.lock_func;
Unlock_Display = info.info.x11.unlock_func;
setXWindowMinSize();
}
else
{
@ -1050,6 +1034,25 @@ void LLWindowSDL::setMouseClipping( BOOL b )
//SDL_WM_GrabInput(b ? SDL_GRAB_ON : SDL_GRAB_OFF);
}
// virtual
void LLWindowSDL::setMinSize(U32 min_width, U32 min_height)
{
LLWindow::setMinSize(min_width, min_height);
#if LL_X11
// Set the minimum size limits for X11 window
// so the window manager doesn't allow resizing below those limits.
XSizeHints* hints = XAllocSizeHints();
hints->flags |= PMinSize;
hints->min_width = mMinWindowWidth;
hints->min_height = mMinWindowHeight;
XSetWMNormalHints(mSDL_Display, mSDL_XWindowID, hints);
XFree(hints);
#endif
}
BOOL LLWindowSDL::setCursorPosition(const LLCoordWindow position)
{
BOOL result = TRUE;
@ -1880,12 +1883,6 @@ void LLWindowSDL::gatherInput()
}
break;
}
#if LL_X11
// The minimum size limits should be reset after
// each successful SDL_SetVideoMode() call.
setXWindowMinSize();
#endif
mCallbacks->handleResize(this, width, height);
break;

View File

@ -76,6 +76,7 @@ public:
/*virtual*/ void captureMouse();
/*virtual*/ void releaseMouse();
/*virtual*/ void setMouseClipping( BOOL b );
/*virtual*/ void setMinSize(U32 min_width, U32 min_height);
/*virtual*/ BOOL isClipboardTextAvailable();
/*virtual*/ BOOL pasteTextFromClipboard(LLWString &dst);
@ -140,7 +141,6 @@ public:
#if LL_X11
static Window get_SDL_XWindowID(void);
static Display* get_SDL_Display(void);
void setXWindowMinSize();
#endif // LL_X11
protected: