summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow/llwindow.cpp')
-rw-r--r--indra/llwindow/llwindow.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index dc3a1099b1..4919605afd 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -111,6 +111,8 @@ LLWindow::LLWindow(LLWindowCallbacks* callbacks, BOOL fullscreen, U32 flags)
mCursorHidden(FALSE),
mBusyCount(0),
mIsMouseClipping(FALSE),
+ mMinWindowWidth(S32_MAX), // just a sanity check - actual minimum size is stored in settings.xml
+ mMinWindowHeight(S32_MAX),
mSwapMethod(SWAP_METHOD_UNDEFINED),
mHideCursorPermanent(FALSE),
mFlags(flags),
@@ -179,6 +181,34 @@ void *LLWindow::getMediaWindow()
return getPlatformWindow();
}
+BOOL LLWindow::setSize(LLCoordScreen size)
+{
+ if (!getMaximized())
+ {
+ size.mX = llmin(size.mX, mMinWindowWidth);
+ size.mY = llmin(size.mY, mMinWindowHeight);
+ }
+ return setSizeImpl(size);
+}
+
+
+// virtual
+void LLWindow::setMinSize(U32 min_width, U32 min_height)
+{
+ mMinWindowWidth = min_width;
+ mMinWindowHeight = min_height;
+
+ LLCoordScreen cur_size;
+ if (!getMaximized() && getSize(&cur_size))
+ {
+ if (cur_size.mX < mMinWindowWidth || cur_size.mY < mMinWindowHeight)
+ {
+ setSizeImpl(LLCoordScreen(llmin(cur_size.mX, mMinWindowWidth), llmin(cur_size.mY, mMinWindowHeight)));
+ }
+ }
+
+}
+
//virtual
void LLWindow::processMiscNativeEvents()
{