diff --git a/modules/gui/qt/components/interface_widgets.cpp b/modules/gui/qt/components/interface_widgets.cpp index 1ce43873f5..54470f330b 100644 --- a/modules/gui/qt/components/interface_widgets.cpp +++ b/modules/gui/qt/components/interface_widgets.cpp @@ -402,9 +402,9 @@ void VideoWidget::mouseDoubleClickEvent( QMouseEvent *event ) } -void VideoWidget::release( void ) +void VideoWidget::release( bool forced ) { - msg_Dbg( p_intf, "Video is not needed anymore" ); + msg_Dbg( p_intf, "video widget is %s", forced ? "orphaned" : "released" ); if( stable ) { diff --git a/modules/gui/qt/components/interface_widgets.hpp b/modules/gui/qt/components/interface_widgets.hpp index 95d81932ce..583f2d1f50 100644 --- a/modules/gui/qt/components/interface_widgets.hpp +++ b/modules/gui/qt/components/interface_widgets.hpp @@ -60,7 +60,7 @@ public: virtual ~VideoWidget(); bool request( struct vout_window_t * ); - void release( void ); + void release( bool forced ); void sync( void ); protected: diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp index 9593b87c30..095c765932 100644 --- a/modules/gui/qt/main_interface.cpp +++ b/modules/gui/qt/main_interface.cpp @@ -205,8 +205,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) connect( this, SIGNAL(askGetVideo(struct vout_window_t*, unsigned, unsigned, bool, bool*)), this, SLOT(getVideoSlot(struct vout_window_t*, unsigned, unsigned, bool, bool*)), Qt::BlockingQueuedConnection ); - connect( this, SIGNAL(askReleaseVideo( void )), - this, SLOT(releaseVideoSlot( void )), + connect( this, SIGNAL(askReleaseVideo( bool )), + this, SLOT(releaseVideoSlot( bool )), Qt::BlockingQueuedConnection ); CONNECT( this, askVideoOnTop(bool), this, setVideoOnTop(bool)); @@ -274,7 +274,7 @@ MainInterface::~MainInterface() showTab( bgWidget ); if( videoWidget ) - releaseVideoSlot(); + releaseVideoSlot(true); /* Be sure to kill the actionsManager... Only used in the MI and control */ ActionsManager::killInstance(); @@ -771,17 +771,17 @@ void MainInterface::getVideoSlot( struct vout_window_t *p_wnd, /* Asynchronous call from the WindowClose function */ void MainInterface::releaseVideo( void ) { - emit askReleaseVideo(); + emit askReleaseVideo(false); } /* Function that is CONNECTED to the previous emit */ -void MainInterface::releaseVideoSlot( void ) +void MainInterface::releaseVideoSlot( bool forced ) { /* This function is called when the embedded video window is destroyed, * or in the rare case that the embedded window is still here but the * Qt interface exits. */ assert( videoWidget ); - videoWidget->release(); + videoWidget->release( forced ); setVideoOnTop( false ); setVideoFullScreen( false ); hideResumePanel(); @@ -1674,7 +1674,7 @@ void MainInterface::closeEvent( QCloseEvent *e ) if ( b_minimalView ) setMinimalView( false ); if( videoWidget ) - releaseVideoSlot(); + releaseVideoSlot( true ); emit askToQuit(); /* ask THEDP to quit, so we have a unique method */ /* Accept session quit. Otherwise we break the desktop mamager. */ e->accept(); diff --git a/modules/gui/qt/main_interface.hpp b/modules/gui/qt/main_interface.hpp index b749f7da74..e73a6b5ce6 100644 --- a/modules/gui/qt/main_interface.hpp +++ b/modules/gui/qt/main_interface.hpp @@ -217,7 +217,7 @@ public slots: /* Manage the Video Functions from the vout threads */ void getVideoSlot( struct vout_window_t *, unsigned i_width, unsigned i_height, bool, bool * ); - void releaseVideoSlot( void ); + void releaseVideoSlot( bool forced ); void emitBoss(); void emitRaise(); @@ -270,7 +270,7 @@ protected slots: signals: void askGetVideo( struct vout_window_t *, unsigned, unsigned, bool, bool * ); - void askReleaseVideo( ); + void askReleaseVideo( bool ); void askVideoToResize( unsigned int, unsigned int ); void askVideoSetFullScreen( bool ); void askHideMouse( bool );