From c48bf0a156043495cb8ff6c4bff51dcdbe32c7a3 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sun, 21 Aug 2016 03:31:26 +0200 Subject: [PATCH] Backed out changeset: 79b4f86861fb --- indra/llwindow/llwindow.h | 5 +---- indra/llwindow/llwindowwin32.cpp | 32 +++++++------------------------- indra/llwindow/llwindowwin32.h | 5 +---- indra/newview/llviewerwindow.cpp | 5 +---- 4 files changed, 10 insertions(+), 37 deletions(-) diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 6ff41698f6..fd4efe5346 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -168,10 +168,7 @@ public: virtual LLSD getNativeKeyData() { return LLSD::emptyMap(); } // Get system UI size based on DPI (for 96 DPI UI size should be 1.0) - // Determine scaling of the display we show the viewer - //virtual F32 getSystemUISize() { return 1.0f; } - virtual F32 getSystemUISize(S32 x, S32 y) { return 1.0f; } - // + virtual F32 getSystemUISize() { return 1.0f; } // Window Title Access //this needs to be overridden for all platforms diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 65605a1c22..1144b75257 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -3966,10 +3966,7 @@ BOOL LLWindowWin32::handleImeRequests(WPARAM request, LPARAM param, LRESULT *res return FALSE; } -// Determine scaling of the display we show the viewer -//F32 LLWindowWin32::getSystemUISize() -F32 LLWindowWin32::getSystemUISize(S32 x, S32 y) -// +F32 LLWindowWin32::getSystemUISize() { // Type fix //float scale_value = 0; @@ -3996,30 +3993,15 @@ F32 LLWindowWin32::getSystemUISize(S32 x, S32 y) HRESULT hr = E_FAIL; // Get the DPI for the main monitor, and set the scaling factor - // Determine scaling of the display we show the viewer - //pt.x = 1; - //pt.y = 1; - pt.x = x; - pt.y = y; + pt.x = 1; + pt.y = 1; + // Get scaling for primary display, assuming that's where we open the viewer + //hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST); + hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY); // - hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST); hr = pGDFM(hMonitor, MDT_EFFECTIVE_DPI, &dpix, &dpiy); - // Check result before using it - //scale_value = dpix / 96.0f; - if (hr == S_OK) - { - scale_value = dpix / 96.0f; - } - else - { - LL_WARNS() << "Could not determine DPI for monitor. Defaulting to 100 %" << LL_ENDL; - scale_value = 1.0f; - } - // + scale_value = dpix / 96.0f; } - - // Free library early - not needed anymore - FreeLibrary(hShcore); } else { diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 5d106ea79c..15c968e82f 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -111,10 +111,7 @@ public: /*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async); void openFile(const std::string& file_name); - // Determine scaling of the display we show the viewer - /*virtual*/ //F32 getSystemUISize(); - /*virtual*/ F32 getSystemUISize(S32 x, S32 y); - // + /*virtual*/ F32 getSystemUISize(); // Window Title Access /*virtual*/ void setTitle(const std::string& win_title); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index f19bde8216..2eae87250a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1821,10 +1821,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) } - // Determine scaling of the display we show the viewer - //F32 system_scale_factor = mWindow->getSystemUISize(); - F32 system_scale_factor = mWindow->getSystemUISize(p.x, p.y); - // + F32 system_scale_factor = mWindow->getSystemUISize(); if (p.first_run || gSavedSettings.getF32("LastSystemUIScaleFactor") != system_scale_factor) { mSystemUIScaleFactorChanged = true;