qt5-qtbase/qtbase-hidpi_scale_at_192.patch

14 lines
848 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
2018-09-21 07:43:57 +00:00
index 7f2793b2..3ff6a924 100644
2017-09-07 13:54:01 +00:00
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
2018-09-21 07:43:57 +00:00
@@ -753,7 +753,7 @@ void QXcbScreen::updateGeometry(const QRect &geometry, uint8_t rotation)
m_sizeMillimeters = sizeInMillimeters(geometry.size(), m_virtualDesktop->dpi());
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);