[vlc-devel] [PATCH] Qt: fix a wrong logic for the check of the fullscreen screen number
Adrien Maglo
magsoft at videolan.org
Thu Nov 23 17:40:13 CET 2017
---
modules/gui/qt/components/controller.cpp | 2 +-
modules/gui/qt/main_interface.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/gui/qt/components/controller.cpp b/modules/gui/qt/components/controller.cpp
index 08a08d2212..2a732d1f12 100644
--- a/modules/gui/qt/components/controller.cpp
+++ b/modules/gui/qt/components/controller.cpp
@@ -986,7 +986,7 @@ void FullscreenControllerWidget::toggleFullwidth()
int FullscreenControllerWidget::targetScreen()
{
- if( i_screennumber < 0 || i_screennumber > QApplication::desktop()->screenCount() )
+ if( i_screennumber < 0 || i_screennumber >= QApplication::desktop()->screenCount() )
return QApplication::desktop()->screenNumber( p_intf->p_sys->p_mi );
return i_screennumber;
}
diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index 787abbf81f..3fbd58e5eb 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -860,7 +860,7 @@ void MainInterface::setVideoFullScreen( bool fs )
* than current number of screens, take screennumber where current interface
* is
*/
- if( numscreen == -1 || numscreen > QApplication::desktop()->screenCount() )
+ if( numscreen < 0 || numscreen >= QApplication::desktop()->screenCount() )
numscreen = QApplication::desktop()->screenNumber( p_intf->p_sys->p_mi );
QRect screenres = QApplication::desktop()->screenGeometry( numscreen );
--
2.14.1
More information about the vlc-devel
mailing list