summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindow.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2011-12-08 11:02:00 -0800
committerRichard Linden <none@none>2011-12-08 11:02:00 -0800
commitdd9263d01780fe23b8c329e0fd8d8c140b04c174 (patch)
tree53f8c1fc6d299576d82b7932079ea0c4d6910990 /indra/llwindow/llwindow.cpp
parent9fbee8bd46e1fae770deedb960701899a8e18b84 (diff)
parent1231c86d2fc1f4a93c97e9c42e58c917f71b6718 (diff)
Automated merge with http://hg.secondlife.com/viewer-development
Diffstat (limited to 'indra/llwindow/llwindow.cpp')
-rw-r--r--indra/llwindow/llwindow.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 9d0d73b81e..1351bed547 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -112,6 +112,8 @@ LLWindow::LLWindow(LLWindowCallbacks* callbacks, BOOL fullscreen, U32 flags)
mCursorHidden(FALSE),
mBusyCount(0),
mIsMouseClipping(FALSE),
+ mMinWindowWidth(0),
+ mMinWindowHeight(0),
mSwapMethod(SWAP_METHOD_UNDEFINED),
mHideCursorPermanent(FALSE),
mFlags(flags),
@@ -180,6 +182,36 @@ 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, bool enforce_immediately)
+{
+ mMinWindowWidth = min_width;
+ mMinWindowHeight = min_height;
+
+ if (enforce_immediately)
+ {
+ 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()
{