[vlc-devel] [PATCH] qt: qvlcframe: replace deprecated QApplication::desktop()

Alexandre Janniaux ajanni at videolabs.io
Tue Jul 30 15:30:34 CEST 2019


It keeps the intent to place the dialog on the primary screen if no
previous position has been saved.
---
 modules/gui/qt/util/qvlcframe.hpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/util/qvlcframe.hpp b/modules/gui/qt/util/qvlcframe.hpp
index a516c7b285..60be77c7f3 100644
--- a/modules/gui/qt/util/qvlcframe.hpp
+++ b/modules/gui/qt/util/qvlcframe.hpp
@@ -32,6 +32,7 @@
 #include <QDesktopWidget>
 #include <QSettings>
 #include <QStyle>
+#include <QScreen>
 
 #include "qt.hpp"
 
@@ -74,7 +75,11 @@ class QVLCTools
             widget->resize(defSize);
 
             if(defPos.x() == 0 && defPos.y()==0)
-               widget->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, widget->size(), qApp->desktop()->availableGeometry()));
+            {
+              auto geometry = qApp->primaryScreen()->availableGeometry();
+              widget->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter,
+                                                      widget->size(), geometry));
+            }
             return true;
           }
           return false;
-- 
2.22.0



More information about the vlc-devel mailing list