From 070116f2120e9e3e546a09d209ee3222affc7f93 Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Wed, 13 Jul 2016 20:28:29 +0300 Subject: MAINT-6493 SL Viewer does not respect the Windows 10 display setting size slider --- indra/newview/llviewerwindow.cpp | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index c17c50fd88..f47a37fcda 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1655,7 +1655,8 @@ LLViewerWindow::LLViewerWindow(const Params& p) mResDirty(false), mStatesDirty(false), mCurrResolutionIndex(0), - mProgressView(NULL) + mProgressView(NULL), + mSystemUIScaleFactorChanged(false) { // gKeyboard is still NULL, so it doesn't do LLWindowListener any good to // pass its value right now. Instead, pass it a nullary function that @@ -1743,6 +1744,16 @@ LLViewerWindow::LLViewerWindow(const Params& p) gSavedSettings.setS32("FullScreenHeight",scr.mY); } + + F32 system_scale_factor = mWindow->getSystemUISize(); + if (p.first_run || gSavedSettings.getF32("LastSystemUIScaleFactor") != system_scale_factor) + { + mSystemUIScaleFactorChanged = true; + gSavedSettings.setF32("LastSystemUIScaleFactor", system_scale_factor); + gSavedSettings.setF32("UIScaleFactor", system_scale_factor); + } + + // 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 = gSavedSettings.getF32("UIScaleFactor"); @@ -1838,6 +1849,28 @@ LLViewerWindow::LLViewerWindow(const Params& p) mWorldViewRectScaled = calcScaledRect(mWorldViewRectRaw, mDisplayScale); } +//static +void LLViewerWindow::showSystemUIScaleFactorChanged() +{ + LLNotificationsUtil::add("SystemUIScaleFactorChanged", LLSD(), LLSD(), onSystemUIScaleFactorChanged); +} + +//static +bool LLViewerWindow::onSystemUIScaleFactorChanged(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if(option == 0) + { + LLFloaterReg::toggleInstanceOrBringToFront("preferences"); + LLFloater* pref_floater = LLFloaterReg::getInstance("preferences"); + LLTabContainer* tab_container = pref_floater->getChild("pref core"); + tab_container->selectTabByName("advanced1"); + + } + return false; +} + + void LLViewerWindow::initGLDefaults() { gGL.setSceneBlendType(LLRender::BT_ALPHA); -- cgit v1.2.3 From cf93c1c81d35d79279bb9ddc7445afac09f3d57f Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Thu, 18 Aug 2016 19:43:48 +0300 Subject: MAINT-5992 Second Life unusable on Windows 10 with 4k monitor SL forcibly overrides DPI compatibility option --- indra/newview/llviewerwindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index f47a37fcda..ff7722b90e 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1593,6 +1593,13 @@ BOOL LLViewerWindow::handleDeviceChange(LLWindow *window) return FALSE; } +void LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height) +{ + gSavedSettings.setF32("UIScaleFactor", ui_scale_factor); + LLViewerWindow::reshape(window_width, window_height); + mResDirty = true; +} + void LLViewerWindow::handlePingWatchdog(LLWindow *window, const char * msg) { LLAppViewer::instance()->pingMainloopTimeout(msg); -- cgit v1.2.3 From 7a7dc795f64c7a8ac6de055db5fcfe83d821810d Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Mon, 26 Sep 2016 00:58:25 +0300 Subject: MAINT-6744 'System UI size factor has changed... ' shouldn't appear after installation --- indra/newview/llviewerwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 79ddc43a3e..9679f69e2c 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1755,7 +1755,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) F32 system_scale_factor = mWindow->getSystemUISize(); if (p.first_run || gSavedSettings.getF32("LastSystemUIScaleFactor") != system_scale_factor) { - mSystemUIScaleFactorChanged = true; + mSystemUIScaleFactorChanged = !p.first_run; gSavedSettings.setF32("LastSystemUIScaleFactor", system_scale_factor); gSavedSettings.setF32("UIScaleFactor", system_scale_factor); } -- cgit v1.2.3 From 89844b345e8bfc69c5f0bd49bdc402d0b1c24e3b Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 30 Sep 2016 17:36:50 +0300 Subject: MAINT-6786 scale gets out of bonds and causes crash --- indra/newview/llviewerwindow.cpp | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 9679f69e2c..4f4b33fa8c 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -251,6 +251,11 @@ BOOL gDisplayBadge = FALSE; static const U8 NO_FACE = 255; BOOL gQuietSnapshot = FALSE; +// Minimum value for UIScaleFactor, also defined in preferences, ui_scale_slider +static const F32 MIN_UI_SCALE = 0.75f; +// 2.0 in preferences, but win10 supports larger scaling and value is used more as +// sanity check, so leaving space for larger values from DPI updates. +static const F32 MAX_UI_SCALE = 7.0f; static const F32 MIN_DISPLAY_SCALE = 0.75f; std::string LLViewerWindow::sSnapshotBaseName; @@ -1595,9 +1600,16 @@ BOOL LLViewerWindow::handleDeviceChange(LLWindow *window) void LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height) { - gSavedSettings.setF32("UIScaleFactor", ui_scale_factor); - LLViewerWindow::reshape(window_width, window_height); - mResDirty = true; + if (ui_scale_factor >= MIN_UI_SCALE && ui_scale_factor <= MAX_UI_SCALE) + { + gSavedSettings.setF32("UIScaleFactor", ui_scale_factor); + LLViewerWindow::reshape(window_width, window_height); + mResDirty = true; + } + else + { + LL_WARNS() << "DPI change caused UI scale to go out of bounds: " << ui_scale_factor << LL_ENDL; + } } void LLViewerWindow::handlePingWatchdog(LLWindow *window, const char * msg) @@ -1753,6 +1765,11 @@ LLViewerWindow::LLViewerWindow(const Params& p) F32 system_scale_factor = mWindow->getSystemUISize(); + if (system_scale_factor < MIN_UI_SCALE || system_scale_factor > MAX_UI_SCALE) + { + // reset to default; + system_scale_factor = 1.f; + } if (p.first_run || gSavedSettings.getF32("LastSystemUIScaleFactor") != system_scale_factor) { mSystemUIScaleFactorChanged = !p.first_run; @@ -1763,7 +1780,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) // 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 = gSavedSettings.getF32("UIScaleFactor"); + F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE); mDisplayScale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f)); mDisplayScale *= ui_scale_factor; @@ -5251,7 +5268,7 @@ F32 LLViewerWindow::getWorldViewAspectRatio() const void LLViewerWindow::calcDisplayScale() { - F32 ui_scale_factor = gSavedSettings.getF32("UIScaleFactor"); + F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE); LLVector2 display_scale; display_scale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f)); display_scale *= ui_scale_factor; @@ -5264,7 +5281,7 @@ void LLViewerWindow::calcDisplayScale() if (display_scale != mDisplayScale) { - LL_INFOS() << "Setting display scale to " << display_scale << LL_ENDL; + LL_INFOS() << "Setting display scale to " << display_scale << " for ui scale: " << ui_scale_factor << LL_ENDL; mDisplayScale = display_scale; // Init default fonts -- cgit v1.2.3 From 1ff67ec5124b5b08e1e0d050d06773c9d3c889fc Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Tue, 8 Nov 2016 01:28:17 +0200 Subject: MAINT-6914 Increase maximum UI size value to 4.0 --- indra/newview/llviewerwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 4f4b33fa8c..9e68bb78e0 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -253,7 +253,7 @@ BOOL gQuietSnapshot = FALSE; // Minimum value for UIScaleFactor, also defined in preferences, ui_scale_slider static const F32 MIN_UI_SCALE = 0.75f; -// 2.0 in preferences, but win10 supports larger scaling and value is used more as +// 4.0 in preferences, but win10 supports larger scaling and value is used more as // sanity check, so leaving space for larger values from DPI updates. static const F32 MAX_UI_SCALE = 7.0f; static const F32 MIN_DISPLAY_SCALE = 0.75f; -- cgit v1.2.3