[vlc-devel] [PATCH 1/2] contrib: qt: prefer lower value when rounding fractional scaling

Pierre Lamot pierre at videolabs.io
Tue Feb 20 17:58:49 CET 2018


---
 ...er-value-when-rounding-fractional-scaling.patch | 25 ++++++++++++++++++++++
 contrib/src/qt/rules.mak                           |  3 ++-
 2 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 contrib/src/qt/0003-QPA-prefer-lower-value-when-rounding-fractional-scaling.patch

diff --git a/contrib/src/qt/0003-QPA-prefer-lower-value-when-rounding-fractional-scaling.patch b/contrib/src/qt/0003-QPA-prefer-lower-value-when-rounding-fractional-scaling.patch
new file mode 100644
index 0000000000..6721e73d0b
--- /dev/null
+++ b/contrib/src/qt/0003-QPA-prefer-lower-value-when-rounding-fractional-scaling.patch
@@ -0,0 +1,25 @@
+From 169f145af591e78c3edc68a5a02130c8fd0973c5 Mon Sep 17 00:00:00 2001
+From: VideoLAN Buildbot <buildbot at videolan.org>
+Date: Tue, 13 Feb 2018 09:31:44 +0000
+Subject: [PATCH] Windows QPA: prefer lower value when rounding fractional scaling
+
+---
+ src/plugins/platforms/windows/qwindowsscreen.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp
+index 5accbe8..9b4cd55 100644
+--- a/src/plugins/platforms/windows/qwindowsscreen.cpp
++++ b/src/plugins/platforms/windows/qwindowsscreen.cpp
+@@ -258,7 +258,7 @@ qreal QWindowsScreen::pixelDensity() const
+     // 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 ceil(logicalDpi().first / 96. - 0.5);
+ }
+ 
+ /*!
+-- 
+2.11.0
+
diff --git a/contrib/src/qt/rules.mak b/contrib/src/qt/rules.mak
index 3bc0fce4b8..769adbcea8 100644
--- a/contrib/src/qt/rules.mak
+++ b/contrib/src/qt/rules.mak
@@ -22,8 +22,9 @@ $(TARBALLS)/qt-$(QT_VERSION).tar.xz:
 qt: qt-$(QT_VERSION).tar.xz .sum-qt
 	$(UNPACK)
 	mv qtbase-opensource-src-$(QT_VERSION) qt-$(QT_VERSION)
-	$(APPLY) $(SRC)/qt/0001-Windows-QPA-Reimplement-calculation-of-window-frames_56.patch  
+	$(APPLY) $(SRC)/qt/0001-Windows-QPA-Reimplement-calculation-of-window-frames_56.patch
 	$(APPLY) $(SRC)/qt/0002-Windows-QPA-Use-new-EnableNonClientDpiScaling-for-Wi_56.patch
+	$(APPLY) $(SRC)/qt/0003-QPA-prefer-lower-value-when-rounding-fractional-scaling.patch
 	$(APPLY) $(SRC)/qt/systray-no-sound.patch
 	$(MOVE)
 
-- 
2.14.1



More information about the vlc-devel mailing list