From 20a2019e4b5a3456d9d5b1ce647b5f459e6e29b1 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Mon, 3 Sep 2018 17:22:15 +0300 Subject: MAINT-9076 Improved support for Retina Displays --- indra/newview/llviewerwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index cef19c9c2d..563ccea704 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1770,7 +1770,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 = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE); + F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getDeviceScaleFactor(); mDisplayScale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f)); mDisplayScale *= ui_scale_factor; @@ -5380,7 +5380,7 @@ F32 LLViewerWindow::getWorldViewAspectRatio() const void LLViewerWindow::calcDisplayScale() { - F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE); + F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getDeviceScaleFactor(); LLVector2 display_scale; display_scale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f)); display_scale *= ui_scale_factor; -- cgit v1.2.3 From 6ce18422de822a195813e5daa890000e1556ac03 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Fri, 19 Oct 2018 19:12:08 +0300 Subject: SL-9766 [Render] [Mac] Alt + left mouse click has severely impaired functions --- indra/newview/llviewerwindow.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 36fbd12e92..024d965c6d 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3016,12 +3016,13 @@ void LLViewerWindow::moveCursorToCenter() S32 x = getWorldViewWidthScaled() / 2; S32 y = getWorldViewHeightScaled() / 2; + F32 scale_factor = mWindow->getDeviceScaleFactor(); + LLUI::setMousePositionScreen(x/scale_factor, y/scale_factor); + //on a forced move, all deltas get zeroed out to prevent jumping mCurrentMousePoint.set(x,y); mLastMousePoint.set(x,y); - mCurrentMouseDelta.set(0,0); - - LLUI::setMousePositionScreen(x, y); + mCurrentMouseDelta.set(0,0); } } -- cgit v1.2.3 From eaeb8605d078846576304028cb46a57081abe113 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Tue, 23 Oct 2018 19:24:03 +0300 Subject: SL-9774 [Render] dragging active Second Life session to second monitor zooms in making viewer unusable --- indra/newview/llviewerwindow.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 024d965c6d..0a8076173e 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1607,6 +1607,14 @@ BOOL LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 } } +BOOL LLViewerWindow::handleWindowDidChangeScreen(LLWindow *window) +{ + LLCoordScreen window_rect; + mWindow->getSize(&window_rect); + reshape(window_rect.mX, window_rect.mY); + return TRUE; +} + void LLViewerWindow::handlePingWatchdog(LLWindow *window, const char * msg) { LLAppViewer::instance()->pingMainloopTimeout(msg); -- cgit v1.2.3 From fc2cdf62f186784548934b64ac4a559c32146614 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Fri, 2 Nov 2018 16:27:34 +0200 Subject: SL-9766 [Render] [Mac] Alt + left mouse click has severely impaired functions FIX #2 --- indra/newview/llviewerwindow.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 0a8076173e..392a843d6c 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3024,8 +3024,7 @@ void LLViewerWindow::moveCursorToCenter() S32 x = getWorldViewWidthScaled() / 2; S32 y = getWorldViewHeightScaled() / 2; - F32 scale_factor = mWindow->getDeviceScaleFactor(); - LLUI::setMousePositionScreen(x/scale_factor, y/scale_factor); + LLUI::setMousePositionScreen(x, y); //on a forced move, all deltas get zeroed out to prevent jumping mCurrentMousePoint.set(x,y); -- cgit v1.2.3 From acc86a9139872e182fbeb5b9fc7daa12c5d2c029 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Mon, 26 Nov 2018 18:02:44 +0200 Subject: =?UTF-8?q?SL-9766=20[Render]=20[Mac]=20Alt=20+=20left=20mouse=20c?= =?UTF-8?q?lick=20has=20severely=20impaired=20functions=20SL-10019=20-=20[?= =?UTF-8?q?Mac]=20[Render]=20Right-click=20context=20menu=20immediately=20?= =?UTF-8?q?disappears=20when=20clicking=20any=20place=20in=20the=20?= =?UTF-8?q?=E2=80=98Inventory=E2=80=99=20floater=20SL-9984=20-=20[Retina]?= =?UTF-8?q?=20Camera=20frustum,=20do=20not=20display=20correctly=20on=20"W?= =?UTF-8?q?ORLD=20MAP"=20window.=20SL-10027=20-=20[Mac]=20[Render]=20Add?= =?UTF-8?q?=20toggle=20for=20Retina=20support=20to=20mitigate=20FPS=20loss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Re-FIX for Retina support. --- 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 392a843d6c..b6e4730d2e 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3029,7 +3029,7 @@ void LLViewerWindow::moveCursorToCenter() //on a forced move, all deltas get zeroed out to prevent jumping mCurrentMousePoint.set(x,y); mLastMousePoint.set(x,y); - mCurrentMouseDelta.set(0,0); + mCurrentMouseDelta.set(0,0); } } -- cgit v1.2.3 From f6bccd6f9eb62178f9f3d912114d12a84a9e42d6 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Mon, 14 Jan 2019 19:07:00 +0200 Subject: - remove getDeviceScaleFactor() and replace it to getSystemUISize() according Ansariel note --- indra/newview/llviewerwindow.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 413fa59879..0d3a52346a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1770,13 +1770,17 @@ LLViewerWindow::LLViewerWindow(const Params& p) gSavedSettings.setS32("FullScreenHeight",scr.mY); } - +#if LL_DARWIN + F32 system_scale_factor = 1.f; +#else 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; } +#endif + if (p.first_run || gSavedSettings.getF32("LastSystemUIScaleFactor") != system_scale_factor) { mSystemUIScaleFactorChanged = !p.first_run; @@ -1787,7 +1791,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 = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getDeviceScaleFactor(); + 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; @@ -5382,7 +5386,7 @@ F32 LLViewerWindow::getWorldViewAspectRatio() const void LLViewerWindow::calcDisplayScale() { - F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getDeviceScaleFactor(); + 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; -- cgit v1.2.3 From 9d1ea470bedc69d57c443c4efa966acdf6f4dbcd Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Tue, 15 Jan 2019 19:44:12 +0200 Subject: - fix scale problem on Windows --- indra/newview/llviewerwindow.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 0d3a52346a..d0c8145e58 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1604,7 +1604,6 @@ BOOL LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 if (ui_scale_factor >= MIN_UI_SCALE && ui_scale_factor <= MAX_UI_SCALE) { gSavedSettings.setF32("LastSystemUIScaleFactor", ui_scale_factor); - gSavedSettings.setF32("UIScaleFactor", ui_scale_factor); LLViewerWindow::reshape(window_width, window_height); mResDirty = true; return TRUE; -- cgit v1.2.3 From 51c2385d5294ff3c34d2130e1be5be8cfd159c17 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 8 Feb 2019 00:52:23 +0100 Subject: Clean up UI scaling --- indra/newview/llviewerwindow.cpp | 41 +--------------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index d0c8145e58..ff5061159e 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1603,7 +1603,6 @@ BOOL LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 { if (ui_scale_factor >= MIN_UI_SCALE && ui_scale_factor <= MAX_UI_SCALE) { - gSavedSettings.setF32("LastSystemUIScaleFactor", ui_scale_factor); LLViewerWindow::reshape(window_width, window_height); mResDirty = true; return TRUE; @@ -1685,8 +1684,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) mResDirty(false), mStatesDirty(false), mCurrResolutionIndex(0), - mProgressView(NULL), - mSystemUIScaleFactorChanged(false) + mProgressView(NULL) { // 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 @@ -1762,13 +1760,6 @@ LLViewerWindow::LLViewerWindow(const Params& p) LLCoordScreen scr; mWindow->getSize(&scr); - if(p.fullscreen && ( scr.mX!=p.width || scr.mY!=p.height)) - { - LL_WARNS() << "Fullscreen has forced us in to a different resolution now using "<getSystemUISize(); @@ -1883,33 +1866,11 @@ LLViewerWindow::LLViewerWindow(const Params& p) mWorldViewRectScaled = calcScaledRect(mWorldViewRectRaw, mDisplayScale); } -//static -void LLViewerWindow::showSystemUIScaleFactorChanged() -{ - LLNotificationsUtil::add("SystemUIScaleFactorChanged", LLSD(), LLSD(), onSystemUIScaleFactorChanged); -} - std::string LLViewerWindow::getLastSnapshotDir() { return sSnapshotDir; } -//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 e58a45ec46c5a9418d6b7f24d33762a8f91ada98 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Fri, 1 Mar 2019 22:39:32 +0200 Subject: mac build fix (add up to: https://bitbucket.org/lindenlab/viewer-cougar/pull-requests/46/clean-up-ui-scaling/diff) --- indra/newview/llviewerwindow.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index e1700abc49..cc10d08f3a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1763,17 +1763,6 @@ LLViewerWindow::LLViewerWindow(const Params& p) LLCoordScreen scr; mWindow->getSize(&scr); -#if LL_DARWIN - F32 system_scale_factor = 1.f; -#else - 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; - } -#endif - // 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(); -- cgit v1.2.3