summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2018-06-07 12:21:23 +0200
committerJani Heikkinen <jani.heikkinen@qt.io>2018-06-09 14:47:30 +0000
commit89f9a3db15940ea87d6ad89f93bfa5aa1d7564fb (patch)
tree17da33bb5fee6810713b2a5ad9e8ef4eba8f5c5b /src/plugins/platforms/xcb
parentde4eb79c2bc761372858ddc35f771191c57e9943 (diff)
Revert "xcb: round down the scale factor for values < 0.8"
This reverts commit 23b139038a1dc9a769a358ab112453abcdd39290. The commit causes a regression on Ubuntu where the DPI setting of the display is ignored. Task-number: QTBUG-68620 Change-Id: Id176f8cda0daef1755abb3aa9382476cc4ed7d71 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp
index e1bd8eb752..df458e85d7 100644
--- a/src/plugins/platforms/xcb/qxcbscreen.cpp
+++ b/src/plugins/platforms/xcb/qxcbscreen.cpp
@@ -750,12 +750,7 @@ void QXcbScreen::updateGeometry(const QRect &geometry, uint8_t rotation)
m_sizeMillimeters = sizeInMillimeters(geometry.size(), virtualDpi());
qreal dpi = geometry.width() / physicalSize().width() * qreal(25.4);
- qreal rawFactor = dpi/96;
- int roundedFactor = qFloor(rawFactor);
- // Round up for .8 and higher. This favors "small UI" over "large UI".
- if (rawFactor - roundedFactor >= 0.8)
- roundedFactor = qCeil(rawFactor);
- m_pixelDensity = qMax(1, roundedFactor);
+ m_pixelDensity = qMax(1, qRound(dpi/96));
m_geometry = geometry;
m_availableGeometry = geometry & m_virtualDesktop->workArea();
QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry);