Commit 6f4519c7 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4: try again to fix the quitting issue

This seems to work on XP, 7 (32+64) and Linux (32+64)

I know it is a hack, but so far, this is the only solution I have found.
parent 5233b6fe
...@@ -173,6 +173,8 @@ void VideoWidget::release( void ) ...@@ -173,6 +173,8 @@ void VideoWidget::release( void )
{ {
msg_Dbg( p_intf, "Video is not needed anymore" ); msg_Dbg( p_intf, "Video is not needed anymore" );
if(!stable)
return;
assert( stable ); assert( stable );
layout->removeWidget( stable ); layout->removeWidget( stable );
stable->deleteLater(); stable->deleteLater();
......
...@@ -223,6 +223,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -223,6 +223,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
CONNECT( THEDP, toolBarConfUpdated(), this, recreateToolbars() ); CONNECT( THEDP, toolBarConfUpdated(), this, recreateToolbars() );
CONNECT( this, askToQuit(), THEDP, quit() );
/** END of CONNECTS**/ /** END of CONNECTS**/
...@@ -263,6 +264,7 @@ MainInterface::~MainInterface() ...@@ -263,6 +264,7 @@ MainInterface::~MainInterface()
if( stackCentralOldWidget == videoWidget ) if( stackCentralOldWidget == videoWidget )
showTab( bgWidget ); showTab( bgWidget );
releaseVideoSlot();
#ifdef WIN32 #ifdef WIN32
if( himl ) if( himl )
ImageList_Destroy( himl ); ImageList_Destroy( himl );
...@@ -584,7 +586,8 @@ void MainInterface::releaseVideo( void ) ...@@ -584,7 +586,8 @@ void MainInterface::releaseVideo( void )
/* Function that is CONNECTED to the previous emit */ /* Function that is CONNECTED to the previous emit */
void MainInterface::releaseVideoSlot( void ) void MainInterface::releaseVideoSlot( void )
{ {
videoWidget->release(); if( videoWidget )
videoWidget->release();
setVideoOnTop( false ); setVideoOnTop( false );
setVideoFullScreen( false ); setVideoFullScreen( false );
...@@ -1130,9 +1133,9 @@ void MainInterface::wheelEvent( QWheelEvent *e ) ...@@ -1130,9 +1133,9 @@ void MainInterface::wheelEvent( QWheelEvent *e )
void MainInterface::closeEvent( QCloseEvent *e ) void MainInterface::closeEvent( QCloseEvent *e )
{ {
e->accept(); //hide();
hide(); e->ignore();
THEDP->quit(); emit askToQuit();
} }
void MainInterface::setInterfaceFullScreen( bool fs ) void MainInterface::setInterfaceFullScreen( bool fs )
......
...@@ -235,6 +235,7 @@ signals: ...@@ -235,6 +235,7 @@ signals:
void askVideoOnTop( bool ); void askVideoOnTop( bool );
void minimalViewToggled( bool ); void minimalViewToggled( bool );
void fullscreenInterfaceToggled( bool ); void fullscreenInterfaceToggled( bool );
void askToQuit();
}; };
......
...@@ -365,8 +365,14 @@ static void Close( vlc_object_t *p_this ) ...@@ -365,8 +365,14 @@ static void Close( vlc_object_t *p_this )
if( !p_sys->b_isDialogProvider ) if( !p_sys->b_isDialogProvider )
var_Destroy (pl_Get(p_this), "qt4-iface"); var_Destroy (pl_Get(p_this), "qt4-iface");
/* And quit */
msg_Dbg( p_intf, "Please die, die, die..." );
QApplication::closeAllWindows();
// QApplication::quit();
QVLCApp::triggerQuit(); QVLCApp::triggerQuit();
msg_Dbg( p_intf, "Please die, die, die 2..." );
vlc_join (p_sys->thread, NULL); vlc_join (p_sys->thread, NULL);
#ifdef Q_WS_X11 #ifdef Q_WS_X11
free (x11_display); free (x11_display);
...@@ -469,9 +475,7 @@ static void *Thread( void *obj ) ...@@ -469,9 +475,7 @@ static void *Thread( void *obj )
/* Launch */ /* Launch */
app.exec(); app.exec();
/* And quit */ msg_Dbg( p_intf, "Exec finished()" );
QApplication::closeAllWindows();
if (p_mi != NULL) if (p_mi != NULL)
{ {
#warning BUG! #warning BUG!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment