]> git.sesse.net Git - vlc/commitdiff
Qt4: main interface drops always-on-top mode when going fullscreen
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 30 May 2010 15:01:00 +0000 (18:01 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 30 May 2010 15:02:07 +0000 (18:02 +0300)
If the main interface does not contain any video, it has no business
with the video-on-top flag.

modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.hpp

index 3fd3741bef1c14f854535a3ea01dcecc7580a36b..bbb6014ac3d50c37f3f190f1113d7dbda2e40708 100644 (file)
@@ -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;
     }
index e629c516748e997bf0c98396b5efd093fcc5e5e7..3d97838c565255d0ce0253f43fca2cd875cfc58b 100644 (file)
@@ -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: