summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowmacosx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow/llwindowmacosx.cpp')
-rw-r--r--indra/llwindow/llwindowmacosx.cpp33
1 files changed, 23 insertions, 10 deletions
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 843294c239..376b8610b5 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -400,6 +400,14 @@ void callWindowUnhide()
}
}
+void callWindowDidChangeScreen()
+{
+ if ( gWindowImplementation && gWindowImplementation->getCallbacks() )
+ {
+ gWindowImplementation->getCallbacks()->handleWindowDidChangeScreen(gWindowImplementation);
+ }
+}
+
void callDeltaUpdate(float *delta, MASK mask)
{
gWindowImplementation->updateMouseDeltas(delta);
@@ -845,7 +853,6 @@ BOOL LLWindowMacOSX::getPosition(LLCoordScreen *position)
BOOL LLWindowMacOSX::getSize(LLCoordScreen *size)
{
- float rect[4];
S32 err = -1;
if(mFullscreen)
@@ -856,10 +863,10 @@ BOOL LLWindowMacOSX::getSize(LLCoordScreen *size)
}
else if(mWindow)
{
- getContentViewBounds(mWindow, rect);
+ const CGSize & sz = getDeviceContentViewSize(mWindow, mGLView);
- size->mX = rect[2];
- size->mY = rect[3];
+ size->mX = sz.width;
+ size->mY = sz.height;
}
else
{
@@ -871,7 +878,6 @@ BOOL LLWindowMacOSX::getSize(LLCoordScreen *size)
BOOL LLWindowMacOSX::getSize(LLCoordWindow *size)
{
- float rect[4];
S32 err = -1;
if(mFullscreen)
@@ -882,10 +888,10 @@ BOOL LLWindowMacOSX::getSize(LLCoordWindow *size)
}
else if(mWindow)
{
- getContentViewBounds(mWindow, rect);
+ const CGSize & sz = getDeviceContentViewSize(mWindow, mGLView);
- size->mX = rect[2];
- size->mY = rect[3];
+ size->mX = sz.width;
+ size->mY = sz.height;
}
else
{
@@ -1124,8 +1130,9 @@ BOOL LLWindowMacOSX::getCursorPosition(LLCoordWindow *position)
cursor_point[1] += mCursorLastEventDeltaY;
}
- position->mX = cursor_point[0];
- position->mY = cursor_point[1];
+ float scale = getDeviceScaleFactor();
+ position->mX = cursor_point[0] * scale;
+ position->mY = cursor_point[1] * scale;
return TRUE;
}
@@ -1334,6 +1341,7 @@ BOOL LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordScreen *to)
mouse_point[0] = from.mX;
mouse_point[1] = from.mY;
+
convertWindowToScreen(mWindow, mouse_point);
to->mX = mouse_point[0];
@@ -1891,6 +1899,11 @@ MASK LLWindowMacOSX::modifiersToMask(S16 modifiers)
return mask;
}
+F32 LLWindowMacOSX::getDeviceScaleFactor()
+{
+ return ::getDeviceUnitSize(mGLView);
+}
+
#if LL_OS_DRAGDROP_ENABLED
/*
S16 LLWindowMacOSX::dragTrackingHandler(DragTrackingMessage message, WindowRef theWindow,