[vlc-devel] [PATCH] qt: qvlcframe: replace deprecated QApplication::desktop()
Jean-Baptiste Kempf
jb at videolan.org
Tue Jul 30 15:36:12 CEST 2019
It should be placed on the screen where the main UI of VLC is. Not the primary screen.
On Tue, Jul 30, 2019, at 15:30, Alexandre Janniaux wrote:
> 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
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
--
Jean-Baptiste Kempf - President
+33 672 704 734
More information about the vlc-devel
mailing list