[vlc-commits] Qt4: Fix docked playlist videoWidget bug

Edward Wang git at videolan.org
Mon Jan 2 17:20:05 CET 2012


vlc/vlc-1.2 | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Mon Jan  2 15:58:49 2012 +0100| [e00a15d33218260723d211aa720fd83c326132ce] | committer: Jean-Baptiste Kempf

Qt4: Fix docked playlist videoWidget bug

Fixes issue where docked playlist doesn't "release" its embedded videoWidget
Close #5588

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 42aab54543c177fb26d74f7fab630151b4ab83f7)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt4/main_interface.cpp |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 19c65a8..f0323d5 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -548,6 +548,15 @@ inline void MainInterface::showTab( QWidget *widget )
             videoWidget->show(); videoWidget->raise();
             stackCentralW->addWidget( videoWidget );
         }
+
+        /* Embedded playlist -> Non-embedded playlist */
+        if( bgWidget == stackCentralOldWidget && widget == videoWidget )
+        {
+            playlistWidget->artContainer->removeWidget( videoWidget );
+            videoWidget->show(); videoWidget->raise();
+            stackCentralW->addWidget( videoWidget );
+            stackCentralW->setCurrentWidget( videoWidget );
+        }
     }
 
     stackCentralW->setCurrentWidget( widget );
@@ -803,6 +812,8 @@ void MainInterface::togglePlaylist()
         /* Playlist is not visible, show it */
         if( stackCentralW->currentWidget() != playlistWidget )
         {
+            if( stackCentralW->indexOf( playlistWidget ) == -1 )
+                stackCentralW->addWidget( playlistWidget );
             showTab( playlistWidget );
         }
         else /* Hide it! */
@@ -829,8 +840,10 @@ void MainInterface::dockPlaylist( bool p_docked )
     b_plDocked = p_docked;
 
     if( !playlistWidget ) return; /* Playlist wasn't created yet */
-    if( !p_docked )
+    if( !p_docked ) /* Previously docked */
     {
+        /* If playlist is invisible don't show it */
+        if( stackCentralW->currentWidget() != playlistWidget ) return;
         stackCentralW->removeWidget( playlistWidget );
 #ifdef WIN32
         playlistWidget->setParent( NULL );
@@ -841,8 +854,11 @@ void MainInterface::dockPlaylist( bool p_docked )
         playlistWidget->show();
         restoreStackOldWidget();
     }
-    else
+    else /* Previously undocked */
     {
+        /* If playlist is invisible don't show it */
+        if( !playlistWidget->isVisible() ) return;
+
         QVLCTools::saveWidgetPosition( p_intf, "Playlist", playlistWidget );
         playlistWidget->setWindowFlags( Qt::Widget ); // Probably a Qt bug here
         // It would be logical that QStackWidget::addWidget reset the flags...



More information about the vlc-commits mailing list