Backed out changeset: 79b4f86861fb

master
Ansariel 2016-08-21 03:31:26 +02:00
parent 97045e4f45
commit c48bf0a156
4 changed files with 10 additions and 37 deletions

View File

@ -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)
// <FS:Ansariel> 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; }
// </FS:Ansariel>
virtual F32 getSystemUISize() { return 1.0f; }
// <FS:TT> Window Title Access
//this needs to be overridden for all platforms

View File

@ -3966,10 +3966,7 @@ BOOL LLWindowWin32::handleImeRequests(WPARAM request, LPARAM param, LRESULT *res
return FALSE;
}
// <FS:Ansariel> Determine scaling of the display we show the viewer
//F32 LLWindowWin32::getSystemUISize()
F32 LLWindowWin32::getSystemUISize(S32 x, S32 y)
// </FS:Ansariel>
F32 LLWindowWin32::getSystemUISize()
{
// <FS:Ansariel> 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
// <FS:Ansariel> 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;
// <FS:Ansariel> Get scaling for primary display, assuming that's where we open the viewer
//hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);
hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY);
// </FS:Ansariel>
hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);
hr = pGDFM(hMonitor, MDT_EFFECTIVE_DPI, &dpix, &dpiy);
// <FS:Ansariel> 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;
}
// </FS:Ansariel>
scale_value = dpix / 96.0f;
}
// <FS:Ansariel> Free library early - not needed anymore
FreeLibrary(hShcore);
}
else
{

View File

@ -111,10 +111,7 @@ public:
/*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async);
void openFile(const std::string& file_name);
// <FS:Ansariel> Determine scaling of the display we show the viewer
/*virtual*/ //F32 getSystemUISize();
/*virtual*/ F32 getSystemUISize(S32 x, S32 y);
// </FS:Ansariel>
/*virtual*/ F32 getSystemUISize();
// <FS:TT> Window Title Access
/*virtual*/ void setTitle(const std::string& win_title);

View File

@ -1821,10 +1821,7 @@ LLViewerWindow::LLViewerWindow(const Params& p)
}
// <FS:Ansariel> 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);
// </FS:Ansariel>
F32 system_scale_factor = mWindow->getSystemUISize();
if (p.first_run || gSavedSettings.getF32("LastSystemUIScaleFactor") != system_scale_factor)
{
mSystemUIScaleFactorChanged = true;