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

14 lines
835 B
Diff
Raw Normal View History

2017-09-07 13:54:01 +00:00
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
2017-12-19 16:48:04 +00:00
index ec0f9ba..6d0d7a6 100644
2017-09-07 13:54:01 +00:00
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
2017-12-19 16:48:04 +00:00
@@ -747,7 +747,7 @@ void QXcbScreen::updateGeometry(const QRect &geometry, uint8_t rotation)
m_sizeMillimeters = sizeInMillimeters(geometry.size(), virtualDpi());
2017-09-07 13:54:01 +00:00
2017-12-19 16:48:04 +00:00
qreal dpi = geometry.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)
2017-12-19 16:48:04 +00:00
m_geometry = geometry;
m_availableGeometry = geometry & m_virtualDesktop->workArea();
2017-01-24 14:45:22 +00:00
QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry);