summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowmacosx.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2021-04-30 03:04:06 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2021-04-30 03:04:06 +0300
commite00edbeb4a7edfe4f190ac7bf2197aa8240e50c6 (patch)
tree25db350e573224fc2900c1e760f7cf429c599abe /indra/llwindow/llwindowmacosx.cpp
parent3ad10e3075840b442f3a8f4593b4b4f10bad48e0 (diff)
parentce65bc2f13409d75dbc6502c970030cc5ed2e5ad (diff)
Merge branch 'master' into DRTVWR-522-maint
# Conflicts: # doc/contributions.txt
Diffstat (limited to 'indra/llwindow/llwindowmacosx.cpp')
-rw-r--r--indra/llwindow/llwindowmacosx.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index d31ec6223c..dfdfe4aa33 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -41,6 +41,7 @@
#include <OpenGL/OpenGL.h>
#include <Carbon/Carbon.h>
#include <CoreServices/CoreServices.h>
+#include <CoreGraphics/CGDisplayConfiguration.h>
extern BOOL gDebugWindowProc;
BOOL gHiDPISupport = TRUE;
@@ -1920,6 +1921,35 @@ void LLWindowMacOSX::interruptLanguageTextInput()
commitCurrentPreedit(mGLView);
}
+std::vector<std::string> LLWindowMacOSX::getDisplaysResolutionList()
+{
+ std::vector<std::string> resolution_list;
+
+ CGDirectDisplayID display_ids[10];
+ uint32_t found_displays = 0;
+ CGError err = CGGetActiveDisplayList(10, display_ids, &found_displays);
+
+ if (kCGErrorSuccess != err)
+ {
+ LL_WARNS() << "Couldn't get a list of active displays" << LL_ENDL;
+ return std::vector<std::string>();
+ }
+
+ for (uint32_t i = 0; i < found_displays; i++)
+ {
+ S32 monitor_width = CGDisplayPixelsWide(display_ids[i]);
+ S32 monitor_height = CGDisplayPixelsHigh(display_ids[i]);
+
+ std::ostringstream sstream;
+ sstream << monitor_width << "x" << monitor_height;;
+ std::string res = sstream.str();
+
+ resolution_list.push_back(res);
+ }
+
+ return resolution_list;
+}
+
//static
std::vector<std::string> LLWindowMacOSX::getDynamicFallbackFontList()
{