Qt4: create video window in fullscreen mode (fixes #2685)
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 29 Oct 2015 20:37:22 +0000 (22:37 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 29 Oct 2015 20:38:23 +0000 (22:38 +0200)
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/qt4.cpp

index 6abda4b..6028b10 100644 (file)
@@ -203,8 +203,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
 
     /* VideoWidget connects for asynchronous calls */
     b_videoFullScreen = false;
-    connect( this, SIGNAL(askGetVideo(WId*,struct vout_window_t*,unsigned*,unsigned *)),
-             this, SLOT(getVideoSlot(WId*,struct vout_window_t*,unsigned*,unsigned*)),
+    connect( this, SIGNAL(askGetVideo(WId*,struct vout_window_t*,unsigned*,unsigned *, bool)),
+             this, SLOT(getVideoSlot(WId*,struct vout_window_t*,unsigned*,unsigned*, bool)),
              Qt::BlockingQueuedConnection );
     connect( this, SIGNAL(askReleaseVideo( void )),
              this, SLOT(releaseVideoSlot( void )),
@@ -705,7 +705,8 @@ void MainInterface::toggleFSC()
  * That's why we have all those emit statements...
  */
 WId MainInterface::getVideo( struct vout_window_t *p_wnd,
-                             unsigned int *pi_width, unsigned int *pi_height )
+                             unsigned int *pi_width, unsigned int *pi_height,
+                             bool fullscreen )
 {
     if( !videoWidget )
         return 0;
@@ -713,12 +714,13 @@ WId MainInterface::getVideo( struct vout_window_t *p_wnd,
     /* This is a blocking call signal. Results are returned through pointers.
      * Beware of deadlocks! */
     WId id;
-    emit askGetVideo( &id, p_wnd, pi_width, pi_height );
+    emit askGetVideo( &id, p_wnd, pi_width, pi_height, fullscreen );
     return id;
 }
 
 void MainInterface::getVideoSlot( WId *p_id, struct vout_window_t *p_wnd,
-                                  unsigned *pi_width, unsigned *pi_height )
+                                  unsigned *pi_width, unsigned *pi_height,
+                                  bool fullscreen )
 {
     /* Hidden or minimized, activate */
     if( isHidden() || isMinimized() )
@@ -729,6 +731,8 @@ void MainInterface::getVideoSlot( WId *p_id, struct vout_window_t *p_wnd,
     *p_id = ret;
     if( ret ) /* The videoWidget is available */
     {
+        setVideoFullScreen( fullscreen );
+
         /* Consider the video active now */
         showVideo();
 
index a0eaa4d..6c6945b 100644 (file)
@@ -70,7 +70,7 @@ public:
 
     /* Video requests from core */
     WId  getVideo( struct vout_window_t *,
-                   unsigned int *pi_width, unsigned int *pi_height );
+                   unsigned int *pi_width, unsigned int *pi_height, bool );
     void releaseVideo( void );
     int  controlVideo( int i_query, va_list args );
 
@@ -210,7 +210,7 @@ public slots:
 
     /* Manage the Video Functions from the vout threads */
     void getVideoSlot( WId *p_id, struct vout_window_t *,
-                       unsigned *pi_width, unsigned *pi_height );
+                       unsigned *pi_width, unsigned *pi_height, bool );
     void releaseVideoSlot( void );
 
     void emitBoss();
@@ -262,7 +262,8 @@ private slots:
     void resumePlayback();
 
 signals:
-    void askGetVideo( WId *, struct vout_window_t *, unsigned *, unsigned * );
+    void askGetVideo( WId *, struct vout_window_t *, unsigned *, unsigned *,
+                      bool );
     void askReleaseVideo( );
     void askVideoToResize( unsigned int, unsigned int );
     void askVideoSetFullScreen( bool );
index 2bb6d24..3cfaffc 100644 (file)
@@ -689,7 +689,7 @@ static int WindowOpen( vout_window_t *p_wnd, const vout_window_cfg_t *cfg )
     unsigned i_width = cfg->width;
     unsigned i_height = cfg->height;
 
-    WId wid = p_mi->getVideo( p_wnd, &i_width, &i_height );
+    WId wid = p_mi->getVideo( p_wnd, &i_width, &i_height, cfg->is_fullscreen );
     if( !wid )
         return VLC_EGENERIC;
 
@@ -713,7 +713,6 @@ static int WindowOpen( vout_window_t *p_wnd, const vout_window_cfg_t *cfg )
 
     p_wnd->control = WindowControl;
     p_wnd->sys = (vout_window_sys_t*)p_mi;
-    emit p_mi->askVideoSetFullScreen( cfg->is_fullscreen );
     return VLC_SUCCESS;
 }