qt5-qtbase/qt5-qtbase-5.8-QTBUG-56140....

49 lines
3.1 KiB
Diff

diff -up qtbase-opensource-src-5.6.2/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp.0295 qtbase-opensource-src-5.6.2/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp
--- qtbase-opensource-src-5.6.2/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp.0295 2017-02-13 12:58:54.062341106 -0600
+++ qtbase-opensource-src-5.6.2/src/plugins/platforms/eglfs/qeglfsdeviceintegration.cpp 2017-02-13 13:00:13.318163725 -0600
@@ -224,7 +224,7 @@ QDpi QEGLDeviceIntegration::logicalDpi()
qreal QEGLDeviceIntegration::pixelDensity() const
{
- return qRound(logicalDpi().first / qreal(100));
+ return qMax(1, qRound(logicalDpi().first / qreal(100)));
}
Qt::ScreenOrientation QEGLDeviceIntegration::nativeOrientation() const
diff -up qtbase-opensource-src-5.6.2/src/plugins/platforms/windows/qwindowsscreen.cpp.0295 qtbase-opensource-src-5.6.2/src/plugins/platforms/windows/qwindowsscreen.cpp
--- qtbase-opensource-src-5.6.2/src/plugins/platforms/windows/qwindowsscreen.cpp.0295 2016-09-16 00:49:42.000000000 -0500
+++ qtbase-opensource-src-5.6.2/src/plugins/platforms/windows/qwindowsscreen.cpp 2017-02-13 12:58:54.063341117 -0600
@@ -258,7 +258,7 @@ qreal QWindowsScreen::pixelDensity() con
// 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);
+ return qMax(1, qRound(logicalDpi().first / 96));
}
/*!
diff -up qtbase-opensource-src-5.6.2/src/plugins/platforms/winrt/qwinrtscreen.cpp.0295 qtbase-opensource-src-5.6.2/src/plugins/platforms/winrt/qwinrtscreen.cpp
--- qtbase-opensource-src-5.6.2/src/plugins/platforms/winrt/qwinrtscreen.cpp.0295 2016-09-16 00:49:42.000000000 -0500
+++ qtbase-opensource-src-5.6.2/src/plugins/platforms/winrt/qwinrtscreen.cpp 2017-02-13 12:58:54.063341117 -0600
@@ -641,7 +641,7 @@ QDpi QWinRTScreen::logicalDpi() const
qreal QWinRTScreen::pixelDensity() const
{
Q_D(const QWinRTScreen);
- return qRound(d->logicalDpi / 96);
+ return qMax(1, qRound(d->logicalDpi / 96));
}
qreal QWinRTScreen::scaleFactor() const
diff -up qtbase-opensource-src-5.6.2/src/plugins/platforms/xcb/qxcbscreen.cpp.0295 qtbase-opensource-src-5.6.2/src/plugins/platforms/xcb/qxcbscreen.cpp
--- qtbase-opensource-src-5.6.2/src/plugins/platforms/xcb/qxcbscreen.cpp.0295 2016-09-16 00:49:42.000000000 -0500
+++ qtbase-opensource-src-5.6.2/src/plugins/platforms/xcb/qxcbscreen.cpp 2017-02-13 12:58:54.063341117 -0600
@@ -565,7 +565,7 @@ void QXcbScreen::updateGeometry(const QR
m_sizeMillimeters = sizeInMillimeters(xGeometry.size(), virtualDpi());
qreal dpi = xGeometry.width() / physicalSize().width() * qreal(25.4);
- m_pixelDensity = qRound(dpi/96);
+ m_pixelDensity = qMax(1, qRound(dpi/96));
m_geometry = QRect(xGeometry.topLeft(), xGeometry.size());
m_availableGeometry = xGeometry & m_virtualDesktop->workArea();
QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry);