[vlc-commits] qt: fix automatic resize on X11 with HiDPI

Pierre Lamot git at videolan.org
Wed Nov 15 16:19:41 CET 2017


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed Nov 15 16:09:28 2017 +0100| [8f05b289e0f3efd3ac0aebf28c6f80a552d91dd8] | committer: Jean-Baptiste Kempf

qt: fix automatic resize on X11 with HiDPI

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt/main_interface.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index fc49683777..b5bbeaf710 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -1275,6 +1275,11 @@ void MainInterface::resizeWindow(int w, int h)
 #if ! HAS_QT510 && defined(QT5_HAS_X11)
     if( QX11Info::isPlatformX11() )
     {
+#if HAS_QT56
+        qreal dpr = devicePixelRatioF();
+#else
+        qreal dpr = devicePixelRatio();
+#endif
         QSize size(w, h);
         size = size.boundedTo(maximumSize()).expandedTo(minimumSize());
         /* X11 window managers are not required to accept geometry changes on
@@ -1284,8 +1289,8 @@ void MainInterface::resizeWindow(int w, int h)
          * request until the ConfigureNotify event on success
          * and not at all if it is rejected. */
         XMoveResizeWindow( QX11Info::display(), winId(),
-                          geometry().x(), geometry().y(),
-                          (unsigned int)size.width(), (unsigned int)size.height());
+                          geometry().x() * dpr, geometry().y() * dpr,
+                          (unsigned int)size.width() * dpr, (unsigned int)size.height() * dpr);
         return;
     }
 #endif



More information about the vlc-commits mailing list