[vlc-devel] commit: Qt4: re-center FSC if the target screen has changed ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sun Oct 4 19:01:05 CEST 2009
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Oct 4 19:53:36 2009 +0300| [480850513b4c3ce3e9919cc8cb564a76cffab022] | committer: Rémi Denis-Courmont
Qt4: re-center FSC if the target screen has changed
This avoids getting a totally misplaced controller if the resolution
is larger than in previous runs, or if the multi-screen layout was
changed.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=480850513b4c3ce3e9919cc8cb564a76cffab022
---
modules/gui/qt4/components/controller.cpp | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp
index 2c6af5e..8cdebf5 100644
--- a/modules/gui/qt4/components/controller.cpp
+++ b/modules/gui/qt4/components/controller.cpp
@@ -710,11 +710,14 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i, QWi
this, setVoutList( vout_thread_t **, int ) );
/* First Move */
+ QRect rect1 = getSettings()->value( "FullScreen/screen" ).toRect();
QPoint pos1 = getSettings()->value( "FullScreen/pos" ).toPoint();
int number = config_GetInt( p_intf, "qt-fullscreen-screennumber" );
if( number == -1 || number > QApplication::desktop()->numScreens() )
number = QApplication::desktop()->screenNumber( p_intf->p_sys->p_mi );
- if( QApplication::desktop()->screenGeometry( number ).contains( pos1, true ) )
+
+ QRect rect = QApplication::desktop()->screenGeometry( number );
+ if( rect == rect1 && rect.contains( pos1, true ) )
{
move( pos1 );
i_screennumber = number;
@@ -729,7 +732,11 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i, QWi
FullscreenControllerWidget::~FullscreenControllerWidget()
{
- getSettings()->setValue( "FullScreen/pos", pos() );
+ QPoint pos1 = pos();
+ QRect rect1 = QApplication::desktop()->screenGeometry( pos1 );
+ getSettings()->setValue( "FullScreen/pos", pos1 );
+ getSettings()->setValue( "FullScreen/screen", rect1 );
+
setVoutList( NULL, 0 );
vlc_mutex_destroy( &lock );
}
More information about the vlc-devel
mailing list