]> git.sesse.net Git - vlc/commitdiff
Qt4: change main interface mode from the UI thread
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 30 May 2010 14:37:12 +0000 (17:37 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 30 May 2010 14:37:12 +0000 (17:37 +0300)
This presumptively fixes a probable race condition. For the umpteenth
time, never ever make any Qt4 UI call from the video output thread!!

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

index add973c82cbed44a01eefbeb6c36542907f5acd4..3fd3741bef1c14f854535a3ea01dcecc7580a36b 100644 (file)
@@ -211,7 +211,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
         if( b_autoresize )
         {
             CONNECT( this, askVideoToResize( unsigned int, unsigned int ),
-                     videoWidget, SetSizing( unsigned int, unsigned int ) );
+                     this, setVideoSize( unsigned int, unsigned int ) );
             CONNECT( videoWidget, sizeChanged( int, int ),
                      this, resizeStack( int,  int ) );
         }
@@ -589,6 +589,13 @@ void MainInterface::releaseVideoSlot( void )
     stackCentralOldWidget = bgWidget;
 }
 
+void MainInterface::setVideoSize( unsigned int w, unsigned int h )
+{
+    if( isFullScreen() || isMaximized() )
+        showNormal();
+    videoWidget->SetSizing( w, h );
+}
+
 /* Slot to change the video always-on-top flag.
  * Emit askVideoOnTop() to invoke this from other thread. */
 void MainInterface::setVideoOnTop( bool on_top )
@@ -616,8 +623,7 @@ int MainInterface::controlVideo( int i_query, va_list args )
     {
         unsigned int i_width  = va_arg( args, unsigned int );
         unsigned int i_height = va_arg( args, unsigned int );
-        if( isFullScreen() || isMaximized() )
-            showNormal();
+
         emit askVideoToResize( i_width, i_height );
         return VLC_SUCCESS;
     }
index 28c852e7378ea42730d4f4fb320677ff4621890f..e629c516748e997bf0c98396b5efd093fcc5e5e7 100644 (file)
@@ -214,6 +214,7 @@ private slots:
             else resize( size() - stackCentralW->size() + QSize( w, h ) );
         debug(); }
 
+    void setVideoSize( unsigned int, unsigned int );
     void setVideoOnTop( bool );
 
 signals: