From a5f6318646a04bd83496765a664a622e886e03bd Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Tue, 24 Jan 2017 08:45:22 -0600 Subject: [PATCH] Broken window scaling (#1381828) --- qt5-qtbase.spec | 11 ++++++++++- qtbase-hidpi_scale_at_192.patch | 11 +++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 qtbase-hidpi_scale_at_192.patch diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 77403dc..cd0c89e 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -66,7 +66,7 @@ BuildRequires: pkgconfig(libsystemd) Name: qt5-qtbase Summary: Qt5 - QtBase components Version: 5.7.1 -Release: 12%{?dist} +Release: 13%{?dist} # See LGPL_EXCEPTIONS.txt, for exception details License: LGPLv2 with exceptions or GPLv3 with exceptions @@ -97,6 +97,11 @@ Patch4: qtbase-opensource-src-5.3.2-QTBUG-35459.patch # namespace QT_VERSION_CHECK to workaround major/minor being pre-defined (#1396755) Patch50: qtbase-opensource-src-5.7.1-QT_VERSION_CHECK.patch +# 1381828 - Broken window scaling for some QT5 applications (#1381828) +# This patch moves the threshold for 2x scaling from the DPI of 144 to 192, +# the same value GNOME uses. It's not a complete solution... +Patch51: qtbase-hidpi_scale_at_192.patch + # 1. Workaround moc/multilib issues # https://bugzilla.redhat.com/show_bug.cgi?id=1290020 # https://bugreports.qt.io/browse/QTBUG-49972 @@ -363,6 +368,7 @@ Qt5 libraries used for drawing widgets and OpenGL items. %patch100 -p1 -b .QTBUG-55583 %patch50 -p1 -b .QT_VERSION_CHECK +%patch51 -p1 -b .hidpi_scale_at_192 %patch52 -p1 -b .moc_macros %patch54 -p1 -b .arm %patch60 -p1 -b .moc_system_defines @@ -972,6 +978,9 @@ fi %changelog +* Tue Jan 24 2017 Rex Dieter - 5.7.1-13 +- Broken window scaling (#1381828) + * Wed Jan 04 2017 Kevin Kofler - 5.7.1-12 - readd plugin __requires_exclude_from filter, it is still needed diff --git a/qtbase-hidpi_scale_at_192.patch b/qtbase-hidpi_scale_at_192.patch new file mode 100644 index 0000000..efde38f --- /dev/null +++ b/qtbase-hidpi_scale_at_192.patch @@ -0,0 +1,11 @@ +--- qtbase-opensource-src-5.7.1/src/plugins/platforms/xcb/qxcbscreen.cpp.orig 2017-01-11 11:42:59.544860428 +0100 ++++ qtbase-opensource-src-5.7.1/src/plugins/platforms/xcb/qxcbscreen.cpp.orig 2017-01-11 11:43:51.142956762 +0100 +@@ -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 = qRound(dpi/96); ++ m_pixelDensity = (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);