[vlc-commits] commit: Qt4: main interface drops always-on-top mode when going fullscreen ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Sun May 30 17:02:43 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun May 30 18:01:00 2010 +0300| [a736053c00778ca35f8653713517558e1e710aea] | committer: Rémi Denis-Courmont 

Qt4: main interface drops always-on-top mode when going fullscreen

If the main interface does not contain any video, it has no business
with the video-on-top flag.

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

 modules/gui/qt4/main_interface.cpp |   19 ++++++++++++++++++-
 modules/gui/qt4/main_interface.hpp |    3 +++
 2 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 3fd3741..bbb6014 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -198,6 +198,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
     /* END CONNECTS ON IM */
 
     /* VideoWidget connects for asynchronous calls */
+    b_videoFullScreen = false;
+    b_videoOnTop = false;
     connect( this, SIGNAL(askGetVideo(WId*,int*,int*,unsigned*,unsigned *)),
              this, SLOT(getVideoSlot(WId*,int*,int*,unsigned*,unsigned*)),
              Qt::BlockingQueuedConnection );
@@ -216,7 +218,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
                      this, resizeStack( int,  int ) );
         }
         CONNECT( this, askVideoSetFullScreen( bool ),
-                 videoWidget, SetFullScreen( bool ) );
+                 this, setVideoFullScreen( bool ) );
         CONNECT( videoWidget, keyPressed( QKeyEvent * ),
                  this, handleKeyPress( QKeyEvent * ) );
     }
@@ -596,10 +598,24 @@ void MainInterface::setVideoSize( unsigned int w, unsigned int h )
     videoWidget->SetSizing( w, h );
 }
 
+void MainInterface::setVideoFullScreen( bool fs )
+{
+    b_videoFullScreen = fs;
+    /* refresh main interface on-top status if needed */
+    setVideoOnTop( b_videoOnTop );
+    videoWidget->SetFullScreen( fs );
+}
+
 /* Slot to change the video always-on-top flag.
  * Emit askVideoOnTop() to invoke this from other thread. */
 void MainInterface::setVideoOnTop( bool on_top )
 {
+    b_videoOnTop = on_top;
+    /* The main interface is not always-on-top if it does not contain
+     * the video (which is to say in fullscreen mode). */
+    if( b_videoFullScreen )
+        on_top = false;
+
     Qt::WindowFlags oldflags = windowFlags(), newflags;
 
     if( on_top )
@@ -638,6 +654,7 @@ int MainInterface::controlVideo( int i_query, va_list args )
     case VOUT_WINDOW_SET_FULLSCREEN:
     {
         bool b_fs = va_arg( args, int );
+
         emit askVideoSetFullScreen( b_fs );
         return VLC_SUCCESS;
     }
diff --git a/modules/gui/qt4/main_interface.hpp b/modules/gui/qt4/main_interface.hpp
index e629c51..3d97838 100644
--- a/modules/gui/qt4/main_interface.hpp
+++ b/modules/gui/qt4/main_interface.hpp
@@ -150,6 +150,8 @@ private:
     bool                 b_notificationEnabled; /// Systray Notifications
     bool                 b_autoresize;          ///< persistent resizeable window
     bool                 b_videoEmbedded;       ///< Want an external Video Window
+    bool                 b_videoFullScreen;     ///< --fullscreen
+    bool                 b_videoOnTop;          ///< --video-on-top
     bool                 b_hideAfterCreation;
     int                  i_visualmode;          ///< Visual Mode
 
@@ -215,6 +217,7 @@ private slots:
         debug(); }
 
     void setVideoSize( unsigned int, unsigned int );
+    void setVideoFullScreen( bool );
     void setVideoOnTop( bool );
 
 signals:



More information about the vlc-commits mailing list