vcl/source/window/window.cxx | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-)
New commits: commit bcba071c0d583a0b3a62d6d718829b906ecc37f2 Author: Jan Holesovsky <ke...@collabora.com> Date: Tue Apr 8 12:58:51 2014 +0200 fdo#77059, hidpi: Increase the threshold of what DPI we consider hi-dpi. Conflicts: vcl/source/window/window.cxx Change-Id: I79802df4c11b3543140672419d78b697848b7c36 Reviewed-on: https://gerrit.libreoffice.org/8892 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index f477b5c..3fb1f00 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -732,6 +732,23 @@ void Window::ImplInitWindowData( WindowType nType ) // ----------------------------------------------------------------------- +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 ) { DBG_ASSERT( mpWindowImpl->mbFrame || pParent, "Window::Window(): pParent == NULL" ); @@ -983,11 +1000,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste } // setup the scale factor for Hi-DPI displays -#ifdef MACOSX - mnDPIScaleFactor = 1; -#else - mnDPIScaleFactor = std::max((sal_Int32)1, (mpWindowImpl->mpFrameData->mnDPIY + 48) / 96); -#endif + mnDPIScaleFactor = CountDPIScaleFactor(mpWindowImpl->mpFrameData->mnDPIY); const StyleSettings& rStyleSettings = maSettings.GetStyleSettings(); sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom(); @@ -1727,12 +1740,7 @@ void Window::ImplInitResolutionSettings() mnDPIY = (mpWindowImpl->mpFrameData->mnDPIY*nScreenZoom)/100; // setup the scale factor for Hi-DPI displays -#ifdef MACOSX - mnDPIScaleFactor = 1; -#else - mnDPIScaleFactor = std::max((sal_Int32)1, (mpWindowImpl->mpFrameData->mnDPIY + 48) / 96); -#endif - + mnDPIScaleFactor = CountDPIScaleFactor(mpWindowImpl->mpFrameData->mnDPIY); SetPointFont( rStyleSettings.GetAppFont() ); } else if ( mpWindowImpl->mpParent )
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits