Reset UI scale factor on first run if OS display scaling is not set to 100%

meow-7.2.2
Ansariel 2019-04-06 02:13:10 +02:00
parent e8dd462d00
commit a85f97fbc7
2 changed files with 25 additions and 1 deletions

View File

@ -25155,7 +25155,7 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<real>0</real>
<integer>0</integer>
</map>
<key>FSLookAtTargetMaxDistance</key>
<map>
@ -25168,6 +25168,19 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<real>1</real>
</map>
<key>FSResetUIScaleOnFirstRun</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>

View File

@ -1841,6 +1841,17 @@ LLViewerWindow::LLViewerWindow(const Params& p)
LLCoordScreen scr;
mWindow->getSize(&scr);
// <FS:Ansariel> 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("FSResetUIScaleOnFirstRun", FALSE);
}
// </FS:Ansariel>
// 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();