qt5-qtbase/qtbase-hidpi_scale_at_192.p...

13 lines
1.0 KiB
Diff

diff -up qtbase-opensource-src-5.7.1/src/plugins/platforms/xcb/qxcbscreen.cpp.hidpi_scale_at_192 qtbase-opensource-src-5.7.1/src/plugins/platforms/xcb/qxcbscreen.cpp
--- qtbase-opensource-src-5.7.1/src/plugins/platforms/xcb/qxcbscreen.cpp.hidpi_scale_at_192 2017-02-09 07:47:26.060096259 -0600
+++ qtbase-opensource-src-5.7.1/src/plugins/platforms/xcb/qxcbscreen.cpp 2017-02-09 07:48:11.497567447 -0600
@@ -633,7 +633,7 @@ void QXcbScreen::updateGeometry(const QR
m_sizeMillimeters = sizeInMillimeters(xGeometry.size(), virtualDpi());
qreal dpi = xGeometry.width() / physicalSize().width() * qreal(25.4);
- m_pixelDensity = qMax(1, qRound(dpi/96));
+ m_pixelDensity = qMax(1, (int) (dpi/96)); // instead of rounding at 1.5, round at 2.0 (same as GNOME)
m_geometry = QRect(xGeometry.topLeft(), xGeometry.size());
m_availableGeometry = xGeometry & m_virtualDesktop->workArea();
QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry);