diff --git a/doc/contributions.txt b/doc/contributions.txt index 24909e6c4017b353c922953ab801004a359fec96..a73bd10295bdbb8989189a2fe63b7c213cf3c747 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -222,6 +222,7 @@ Ansariel Hiller MAINT-8085 MAINT-8723 SL-10385 + SL-10891 Aralara Rajal Arare Chantilly CHUIBUG-191 diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 09d784556723f8084af28c09de1f2393320af372..916781e85bdb35a5284ea45e3cd817afbd736b64 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -16310,6 +16310,19 @@ <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> + <key>Backup</key> + <integer>0</integer> + </map> </map> </llsd> diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index a1edbf6addde539d080cf6b26d64b15843515c4d..51969a70916fa69ba2510e83e2a719efdf57cb67 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1763,12 +1763,19 @@ 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("FSResetUIScaleOnFirstRun")) + { + 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); -#if LL_DARWIN - ui_scale_factor *= mWindow->getSystemUISize(); -#endif + F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getSystemUISize(); mDisplayScale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f)); mDisplayScale *= ui_scale_factor; @@ -5341,11 +5348,7 @@ F32 LLViewerWindow::getWorldViewAspectRatio() const void LLViewerWindow::calcDisplayScale() { - F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE); -#if LL_DARWIN - ui_scale_factor *= mWindow->getSystemUISize(); -#endif - + F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getSystemUISize(); LLVector2 display_scale; display_scale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f)); display_scale *= ui_scale_factor;