Commit 7f485998 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: fix WinXP quitting issue

parent 6c74b935
...@@ -226,6 +226,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -226,6 +226,8 @@ 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**/
...@@ -265,6 +267,8 @@ MainInterface::~MainInterface() ...@@ -265,6 +267,8 @@ 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 );
...@@ -597,6 +601,7 @@ void MainInterface::releaseVideo( void ) ...@@ -597,6 +601,7 @@ 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 )
{ {
if( videoWidget )
videoWidget->release(); videoWidget->release();
setVideoOnTop( false ); setVideoOnTop( false );
setVideoFullScreen( false ); setVideoFullScreen( false );
...@@ -1180,9 +1185,9 @@ void MainInterface::wheelEvent( QWheelEvent *e ) ...@@ -1180,9 +1185,9 @@ void MainInterface::wheelEvent( QWheelEvent *e )
void MainInterface::closeEvent( QCloseEvent *e ) void MainInterface::closeEvent( QCloseEvent *e )
{ {
e->accept(); e->ignore(); /* Do not quit */
hide(); // hide();
THEDP->quit(); emit askToQuit(); /* ask THEDP to quit, so we have a unique method */
} }
void MainInterface::setInterfaceFullScreen( bool fs ) void MainInterface::setInterfaceFullScreen( bool fs )
......
...@@ -244,6 +244,7 @@ signals: ...@@ -244,6 +244,7 @@ signals:
void askVideoOnTop( bool ); void askVideoOnTop( bool );
void minimalViewToggled( bool ); void minimalViewToggled( bool );
void fullscreenInterfaceToggled( bool ); void fullscreenInterfaceToggled( bool );
void askToQuit();
}; };
......
...@@ -396,8 +396,15 @@ static void Close( vlc_object_t *p_this ) ...@@ -396,8 +396,15 @@ static void Close( vlc_object_t *p_this )
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..." );
#ifndef Q_WS_MAC #ifndef Q_WS_MAC
vlc_join (p_sys->thread, NULL); vlc_join (p_sys->thread, NULL);
#endif #endif
...@@ -445,7 +452,7 @@ static void *Thread( void *obj ) ...@@ -445,7 +452,7 @@ static void *Thread( void *obj )
#endif #endif
QSettings::UserScope, "vlc", "vlc-qt-interface" ); QSettings::UserScope, "vlc", "vlc-qt-interface" );
/* Icon setting */ /* Icon setting, Mac uses icon from .icns */
#ifndef Q_WS_MAC #ifndef Q_WS_MAC
if( QDate::currentDate().dayOfYear() >= 352 ) /* One Week before Xmas */ if( QDate::currentDate().dayOfYear() >= 352 ) /* One Week before Xmas */
app.setWindowIcon( QIcon(vlc_christmas_xpm) ); app.setWindowIcon( QIcon(vlc_christmas_xpm) );
...@@ -456,7 +463,7 @@ static void *Thread( void *obj ) ...@@ -456,7 +463,7 @@ static void *Thread( void *obj )
/* Initialize timers and the Dialog Provider */ /* Initialize timers and the Dialog Provider */
DialogsProvider::getInstance( p_intf ); DialogsProvider::getInstance( p_intf );
/* Detect screensize for small screens like TV or EEEpc*/ /* Detect screensize for small screens like TV or Netbooks */
p_intf->p_sys->i_screenHeight = p_intf->p_sys->i_screenHeight =
app.QApplication::desktop()->availableGeometry().height(); app.QApplication::desktop()->availableGeometry().height();
...@@ -499,7 +506,7 @@ static void *Thread( void *obj ) ...@@ -499,7 +506,7 @@ static void *Thread( void *obj )
#endif #endif
/* Last settings */ /* Last settings */
app.setQuitOnLastWindowClosed( false ); app.setQuitOnLastWindowClosed( true );
/* Retrieve last known path used in file browsing */ /* Retrieve last known path used in file browsing */
p_intf->p_sys->filepath = p_intf->p_sys->filepath =
...@@ -513,9 +520,7 @@ static void *Thread( void *obj ) ...@@ -513,9 +520,7 @@ static void *Thread( void *obj )
/* Launch */ /* Launch */
app.exec(); app.exec();
/* And quit */ msg_Dbg( p_intf, "QApp 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