summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/app_settings/settings.xml26
-rwxr-xr-xindra/newview/llappviewer.cpp14
-rw-r--r--indra/newview/llviewerwindow.cpp14
3 files changed, 49 insertions, 5 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 9c055bdc5a..bc6c63985f 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -12927,6 +12927,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>MinWindowHeight</key>
+ <map>
+ <key>Comment</key>
+ <string>SL viewer minimum window height in pixels</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>U32</string>
+ <key>Value</key>
+ <integer>768</integer>
+ </map>
<key>WindowHeight</key>
<map>
<key>Comment</key>
@@ -12934,7 +12945,7 @@
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
- <string>S32</string>
+ <string>U32</string>
<key>Value</key>
<integer>738</integer>
</map>
@@ -12949,6 +12960,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>MinWindowWidth</key>
+ <map>
+ <key>Comment</key>
+ <string>SL viewer minimum window width in pixels</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>U32</string>
+ <key>Value</key>
+ <integer>1024</integer>
+ </map>
<key>WindowWidth</key>
<map>
<key>Comment</key>
@@ -12956,7 +12978,7 @@
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
- <string>S32</string>
+ <string>U32</string>
<key>Value</key>
<integer>1024</integer>
</map>
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 8bf4d94059..9b8f5c5961 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2860,10 +2860,22 @@ bool LLAppViewer::initWindow()
// always start windowed
BOOL ignorePixelDepth = gSavedSettings.getBOOL("IgnorePixelDepth");
+
+ // clamp to minimum window size
+ U32 min_window_width=gSavedSettings.getU32("MinWindowWidth");
+ U32 window_width=gSavedSettings.getU32("WindowWidth");
+ if ( window_width < min_window_width )
+ window_width=min_window_width;
+
+ U32 min_window_height=gSavedSettings.getU32("MinWindowHeight");
+ U32 window_height=gSavedSettings.getU32("WindowHeight");
+ if ( window_height < min_window_height )
+ window_height=min_window_height;
+
gViewerWindow = new LLViewerWindow(gWindowTitle,
VIEWER_WINDOW_CLASSNAME,
gSavedSettings.getS32("WindowX"), gSavedSettings.getS32("WindowY"),
- gSavedSettings.getS32("WindowWidth"), gSavedSettings.getS32("WindowHeight"),
+ window_width, window_height,
gSavedSettings.getBOOL("WindowFullScreen"), ignorePixelDepth);
LL_INFOS("AppInit") << "gViewerwindow created." << LL_ENDL;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index cf21ac4e5d..140cbb4e04 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2161,8 +2161,18 @@ void LLViewerWindow::reshape(S32 width, S32 height)
if (!maximized
&& mWindow->getSize(&window_size))
{
- gSavedSettings.setS32("WindowWidth", window_size.mX);
- gSavedSettings.setS32("WindowHeight", window_size.mY);
+ U32 min_window_width=gSavedSettings.getU32("MinWindowWidth");
+ if ( window_size.mX < min_window_width )
+ window_size.mX=min_window_width;
+ gSavedSettings.setU32("WindowWidth", window_size.mX);
+
+ U32 min_window_height=gSavedSettings.getU32("MinWindowHeight");
+ if ( window_size.mY < min_window_height )
+ window_size.mY=min_window_height;
+ gSavedSettings.setU32("WindowHeight", window_size.mY);
+
+ // tell the OS specific window code about min windoow size
+ mWindow->setMinSize(min_window_width, min_window_height);
}
LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_WIDTH, (F64)width);