diff options
author | callum <none@none> | 2011-11-11 12:29:04 -0800 |
---|---|---|
committer | callum <none@none> | 2011-11-11 12:29:04 -0800 |
commit | e4e4977f5eab5aac24c32b569c5273c4be926cb2 (patch) | |
tree | 93fc0900f80be0660cdd1e33c108aad7ce135a09 /indra/newview | |
parent | 1b56b7d2e5ad2b5c4ca2c733b25d1fd7dc78f634 (diff) |
EXP-1527 FIX Debug values for windowwidth and windowheight can be set below minimum required values
and
EXP-1528 Launching viewer with a settings.xml file with windowwidth and windowheight set below minimum values, launches to those values not minimum window size
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 26 | ||||
-rwxr-xr-x | indra/newview/llappviewer.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 14 |
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); |