[vlc-commits] contrib: qt: prefer lower value when rounding fractional scaling

Pierre Lamot git at videolan.org
Wed Feb 21 12:20:14 CET 2018


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Tue Feb 20 17:58:49 2018 +0100| [44562012f34577a6c82d236614173d7ce392abf1] | committer: Hugo Beauzée-Luyssen

contrib: qt: prefer lower value when rounding fractional scaling

Fix #19679
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=44562012f34577a6c82d236614173d7ce392abf1
---

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

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 00c8d74898..f9bba5345a 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)
 



More information about the vlc-commits mailing list