From 50bda9e2aca69f67da6722e481ce4e9c1a21471b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 4 Nov 2015 11:11:49 +0100 Subject: Windows: Use logical DPI to activate High DPI scaling. High DPI should be disabled when the user chooses small fonts on a High DPI monitor, resulting in lower logical DPI. The auto-algorithm should then be equivalent to that of the device pixel ratio scaling of Qt 5.5. Task-number: QTBUG-49195 Change-Id: I756770ec7251b5b9b901253ded82e829aa50d38b Reviewed-by: Alessandro Portale --- src/plugins/platforms/windows/qwindowsscreen.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowsscreen.cpp') diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp index c603b2bd09..de4ef79b81 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.cpp +++ b/src/plugins/platforms/windows/qwindowsscreen.cpp @@ -280,8 +280,11 @@ QWindow *QWindowsScreen::windowAt(const QPoint &screenPoint, unsigned flags) qreal QWindowsScreen::pixelDensity() const { - const qreal physicalDpi = m_data.geometry.width() / m_data.physicalSizeMM.width() * qreal(25.4); - return qRound(physicalDpi / 96); + // QTBUG-49195: Use logical DPI instead of physical DPI to calculate + // the pixel density since it is reflects the Windows UI scaling. + // High DPI auto scaling should be disabled when the user chooses + // small fonts on a High DPI monitor, resulting in lower logical DPI. + return qRound(logicalDpi().first / 96); } /*! -- cgit v1.2.3