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.cpp35
1 files changed, 24 insertions, 11 deletions
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index c97e014e46..0bf1c4b057 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -38,7 +38,6 @@
#include "lldir.h"
#include "indra_constants.h"
-
#include <OpenGL/OpenGL.h>
#include <Carbon/Carbon.h>
#include <CoreServices/CoreServices.h>
@@ -53,6 +52,7 @@
extern bool gDebugWindowProc;
bool gHiDPISupport = true;
+bool gHDRDisplaySupport = false;
const S32 BITS_PER_PIXEL = 32;
const S32 MAX_NUM_RESOLUTIONS = 32;
@@ -236,6 +236,8 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks,
allowLanguageTextInput(NULL, false);
}
+ setUseMultGL(sUseMultGL);
+
mCallbacks = callbacks;
stop_glerror();
@@ -611,7 +613,7 @@ void callQuitHandler()
{
if (gWindowImplementation && gWindowImplementation->getCallbacks())
{
- if(gWindowImplementation->getCallbacks()->handleCloseRequest(gWindowImplementation))
+ if(gWindowImplementation->getCallbacks()->handleCloseRequest(gWindowImplementation, true))
{
gWindowImplementation->getCallbacks()->handleQuit(gWindowImplementation);
}
@@ -986,7 +988,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;
@@ -1013,7 +1015,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;
@@ -1039,7 +1041,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;
@@ -1225,6 +1227,12 @@ void LLWindowMacOSX::setMouseClipping( bool b )
adjustCursorDecouple();
}
+#if LL_DARWIN
+// For CGSetLocalEventsSuppressionInterval there is no replacement in modern API
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
bool LLWindowMacOSX::setCursorPosition(const LLCoordWindow position)
{
bool result = false;
@@ -1262,6 +1270,10 @@ bool LLWindowMacOSX::setCursorPosition(const LLCoordWindow position)
return result;
}
+#if LL_DARWIN
+#pragma clang diagnostic pop
+#endif
+
bool LLWindowMacOSX::getCursorPosition(LLCoordWindow *position)
{
float cursor_point[2];
@@ -1486,8 +1498,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;
}
@@ -1499,9 +1512,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);
@@ -2638,7 +2651,7 @@ MASK LLWindowMacOSX::modifiersToMask(S16 modifiers)
F32 LLWindowMacOSX::getSystemUISize()
{
- return gHiDPISupport ? ::getDeviceUnitSize(mGLView) : LLWindow::getSystemUISize();
+ return ::getDeviceUnitSize(mGLView);
}
#if LL_OS_DRAGDROP_ENABLED