summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowmacosx.cpp
diff options
context:
space:
mode:
authorRye <rye@alchemyviewer.org>2025-08-20 17:57:06 -0400
committerRye <rye@alchemyviewer.org>2025-08-20 17:57:06 -0400
commitf0db568bf8d313a00e10c1c4ee4dd7f716a9d987 (patch)
tree2b328fe5062a91b326e741cefed3e5f19cbc9485 /indra/llwindow/llwindowmacosx.cpp
parent77514ebddd68ca47bc3751f0a6e55a83deec79a9 (diff)
Rework macOS retina support to remove deprecated code and fix scaled input issues in multimonitor
Diffstat (limited to 'indra/llwindow/llwindowmacosx.cpp')
-rw-r--r--indra/llwindow/llwindowmacosx.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index dadbc83f45..b3f9697867 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -985,7 +985,7 @@ bool LLWindowMacOSX::getPosition(LLCoordScreen *position)
}
else if(mWindow)
{
- const CGPoint & pos = getContentViewBoundsPosition(mWindow);
+ CGPoint pos = getContentViewRect(mWindow).origin;
position->mX = pos.x;
position->mY = pos.y;
@@ -1012,7 +1012,7 @@ bool LLWindowMacOSX::getSize(LLCoordScreen *size)
}
else if(mWindow)
{
- const CGSize & sz = gHiDPISupport ? getDeviceContentViewSize(mWindow, mGLView) : getContentViewBoundsSize(mWindow);
+ CGSize sz = getBackingViewRect(mWindow, mGLView).size;
size->mX = sz.width;
size->mY = sz.height;
@@ -1038,7 +1038,7 @@ bool LLWindowMacOSX::getSize(LLCoordWindow *size)
}
else if(mWindow)
{
- const CGSize & sz = gHiDPISupport ? getDeviceContentViewSize(mWindow, mGLView) : getContentViewBoundsSize(mWindow);
+ CGSize sz = getBackingViewRect(mWindow, mGLView).size;
size->mX = sz.width;
size->mY = sz.height;
@@ -1485,8 +1485,9 @@ bool LLWindowMacOSX::convertCoords(LLCoordScreen from, LLCoordWindow* to)
convertScreenToWindow(mWindow, mouse_point);
- to->mX = mouse_point[0];
- to->mY = mouse_point[1];
+ float scale_factor = getSystemUISize();
+ to->mX = mouse_point[0] * scale_factor;
+ to->mY = mouse_point[1] * scale_factor;
return true;
}
@@ -1498,9 +1499,9 @@ bool LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordScreen *to)
if(mWindow)
{
float mouse_point[2];
-
- mouse_point[0] = from.mX;
- mouse_point[1] = from.mY;
+ float scale_factor = getSystemUISize();
+ mouse_point[0] = from.mX / scale_factor;
+ mouse_point[1] = from.mY / scale_factor;
convertWindowToScreen(mWindow, mouse_point);
@@ -2637,7 +2638,7 @@ MASK LLWindowMacOSX::modifiersToMask(S16 modifiers)
F32 LLWindowMacOSX::getSystemUISize()
{
- return gHiDPISupport ? ::getDeviceUnitSize(mGLView) : LLWindow::getSystemUISize();
+ return ::getDeviceUnitSize(mGLView);
}
#if LL_OS_DRAGDROP_ENABLED