diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-04-11 00:19:58 +0300 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-04-11 00:19:58 +0300 |
commit | 724e3cca96422f480d5cff912e764da82c5de03c (patch) | |
tree | d4eea3907f2fd12afbdc8a328e5497202e49a6e7 /indra | |
parent | d1b649055dfdfe17674fec6ef713a33c6f9b09fe (diff) |
SL-10891 Reset UI scale factor on first run if OS's display scaling is not 100%
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 10 |
2 files changed, 21 insertions, 0 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 1173abf18e..7b69ec6eb2 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16288,6 +16288,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>ResetUIScaleOnFirstRun</key> + <map> + <key>Comment</key> + <string>Resets the UI scale factor on first run due to changed display scaling behavior</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> </map> </llsd> diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index cc10d08f3a..5b764f97fb 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1763,6 +1763,16 @@ LLViewerWindow::LLViewerWindow(const Params& p) LLCoordScreen scr; mWindow->getSize(&scr); + // Reset UI scale factor on first run if OS's display scaling is not 100% + if (gSavedSettings.getBOOL("ResetUIScaleOnFirstRun")) + { + if (mWindow->getSystemUISize() != 1.f) + { + gSavedSettings.setF32("UIScaleFactor", 1.f); + } + gSavedSettings.setBOOL("ResetUIScaleOnFirstRun", FALSE); + } + // Get the real window rect the window was created with (since there are various OS-dependent reasons why // the size of a window or fullscreen context may have been adjusted slightly...) F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getSystemUISize(); |