[vlc-devel] commit: Qt4: move fullscreen window on current viewport (Ilkka Ollakka )

git version control git at videolan.org
Thu Aug 13 21:52:21 CEST 2009


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Thu Aug 13 22:47:07 2009 +0300| [3cddf245543afb17406a2017764d73167fa6bd86] | committer: Ilkka Ollakka 

Qt4: move fullscreen window on current viewport

This restores functionality, that video goes fullscreen on same screen
that vlc player is. For somereason it didn't work correctly when
reparented to QDesktop-screen( num ) widget.

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

 modules/gui/qt4/components/interface_widgets.cpp |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index c0369d1..603f0a1 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -41,6 +41,7 @@
 #include <QDate>
 #include <QMenu>
 #include <QWidgetAction>
+#include <QDesktopWidget>
 
 #ifdef Q_WS_X11
 # include <X11/Xlib.h>
@@ -160,6 +161,7 @@ void VideoWidget::SetFullScreen( bool b_fs )
     Qt::WindowStates newstate = curstate;
     Qt::WindowFlags  newflags = reparentable->windowFlags();
 
+
     if( b_fs )
     {
         newstate |= Qt::WindowFullScreen;
@@ -175,9 +177,18 @@ void VideoWidget::SetFullScreen( bool b_fs )
 
     if( b_fs )
     {   /* Go full-screen */
-        reparentable->setWindowState( newstate );
+        int numscreen = QApplication::desktop()->screenNumber( p_intf->p_sys->p_mi );
+        QRect screenres = QApplication::desktop()->screenGeometry( numscreen );
+
         reparentable->setParent( NULL );
+        reparentable->setWindowState( newstate );
         reparentable->setWindowFlags( newflags );
+        /* To be sure window is on proper-screen in xinerama */
+        if( !screenres.contains( reparentable->pos() ) )
+        {
+            msg_Dbg( p_intf, "Moving video to correct screen");
+            reparentable->move( QPoint( screenres.x(), screenres.y() ) );
+        }
         reparentable->show();
     }
     else




More information about the vlc-devel mailing list