Kaydet (Commit) d0626944 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

fdo#77059, hidpi: Increase the threshold of what DPI we consider hi-dpi.

Change-Id: I79802df4c11b3543140672419d78b697848b7c36
üst f6406c91
...@@ -854,6 +854,23 @@ static bool ImplDoTiledRendering() ...@@ -854,6 +854,23 @@ static bool ImplDoTiledRendering()
#endif #endif
} }
static sal_Int32 CountDPIScaleFactor(sal_Int32 nDPI)
{
sal_Int32 nResult = 1;
#ifndef MACOSX
// Setting of HiDPI is unfortunately all only a heuristic; and to add
// insult to an injury, the system is constantly lying to us about
// the DPI and whatnot
// eg. fdo#77059 - set the value from which we do consider the
// screen hi-dpi to greater than 168
if (nDPI > 168)
nResult = std::max(sal_Int32(1), (nDPI) / 96);
#endif
return nResult;
}
void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData ) void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData )
{ {
DBG_ASSERT( mpWindowImpl->mbFrame || pParent, "Window::Window(): pParent == NULL" ); DBG_ASSERT( mpWindowImpl->mbFrame || pParent, "Window::Window(): pParent == NULL" );
...@@ -1108,11 +1125,8 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste ...@@ -1108,11 +1125,8 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
} }
// setup the scale factor for Hi-DPI displays // setup the scale factor for Hi-DPI displays
#ifdef MACOSX mnDPIScaleFactor = CountDPIScaleFactor(mpWindowImpl->mpFrameData->mnDPIY);
mnDPIScaleFactor = 1;
#else
mnDPIScaleFactor = std::max((sal_Int32)1, (mpWindowImpl->mpFrameData->mnDPIY + 48) / 96);
#endif
const StyleSettings& rStyleSettings = mxSettings->GetStyleSettings(); const StyleSettings& rStyleSettings = mxSettings->GetStyleSettings();
sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom(); sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom();
mnDPIX = (mpWindowImpl->mpFrameData->mnDPIX*nScreenZoom)/100; mnDPIX = (mpWindowImpl->mpFrameData->mnDPIX*nScreenZoom)/100;
...@@ -1810,11 +1824,7 @@ void Window::ImplInitResolutionSettings() ...@@ -1810,11 +1824,7 @@ void Window::ImplInitResolutionSettings()
mnDPIY = (mpWindowImpl->mpFrameData->mnDPIY*nScreenZoom)/100; mnDPIY = (mpWindowImpl->mpFrameData->mnDPIY*nScreenZoom)/100;
// setup the scale factor for Hi-DPI displays // setup the scale factor for Hi-DPI displays
#ifdef MACOSX mnDPIScaleFactor = CountDPIScaleFactor(mpWindowImpl->mpFrameData->mnDPIY);
mnDPIScaleFactor = 1;
#else
mnDPIScaleFactor = std::max((sal_Int32)1, (mpWindowImpl->mpFrameData->mnDPIY + 48) / 96);
#endif
SetPointFont( rStyleSettings.GetAppFont() ); SetPointFont( rStyleSettings.GetAppFont() );
} }
else if ( mpWindowImpl->mpParent ) else if ( mpWindowImpl->mpParent )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment