summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llwindow/llwindow.h3
-rw-r--r--indra/llwindow/llwindowmacosx.cpp8
-rw-r--r--indra/llwindow/llwindowmacosx.h2
-rw-r--r--indra/newview/llviewerwindow.cpp10
4 files changed, 12 insertions, 11 deletions
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index cb0daea2cd..a05ba8cbba 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -166,9 +166,6 @@ public:
// Provide native key event data
virtual LLSD getNativeKeyData() { return LLSD::emptyMap(); }
- // Default scale
- virtual float getDeviceScaleFactor() { return 1.0f; }
-
// Get system UI size based on DPI (for 96 DPI UI size should be 1.0)
virtual F32 getSystemUISize() { return 1.0; }
protected:
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 20853eebd9..b320b93d43 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -1102,7 +1102,7 @@ BOOL LLWindowMacOSX::setCursorPosition(const LLCoordWindow position)
// trigger mouse move callback
LLCoordGL gl_pos;
convertCoords(position, &gl_pos);
- float scale = getDeviceScaleFactor();
+ float scale = getSystemUISize();
gl_pos.mX *= scale;
gl_pos.mY *= scale;
mCallbacks->handleMouseMove(this, gl_pos, (MASK)0);
@@ -1135,7 +1135,7 @@ BOOL LLWindowMacOSX::getCursorPosition(LLCoordWindow *position)
cursor_point[1] += mCursorLastEventDeltaY;
}
- float scale = getDeviceScaleFactor();
+ float scale = getSystemUISize();
position->mX = cursor_point[0] * scale;
position->mY = cursor_point[1] * scale;
@@ -1904,9 +1904,9 @@ MASK LLWindowMacOSX::modifiersToMask(S16 modifiers)
return mask;
}
-F32 LLWindowMacOSX::getDeviceScaleFactor()
+F32 LLWindowMacOSX::getSystemUISize()
{
- return gHiDPISupport ? ::getDeviceUnitSize(mGLView) : LLWindow::getDeviceScaleFactor();
+ return gHiDPISupport ? ::getDeviceUnitSize(mGLView) : LLWindow::getSystemUISize();
}
#if LL_OS_DRAGDROP_ENABLED
diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h
index fc5c9a0054..24651027e8 100644
--- a/indra/llwindow/llwindowmacosx.h
+++ b/indra/llwindow/llwindowmacosx.h
@@ -112,7 +112,7 @@ public:
/*virtual*/ void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b);
/*virtual*/ void interruptLanguageTextInput();
/*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async);
- /*virtual*/ F32 getDeviceScaleFactor();
+ /*virtual*/ F32 getSystemUISize();
static std::vector<std::string> getDynamicFallbackFontList();
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;