Commit 8abd25d4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Qt4: change main interface mode from the UI thread

This presumptively fixes a probable race condition. For the umpteenth
time, never ever make any Qt4 UI call from the video output thread!!
parent 7e26f748
...@@ -211,7 +211,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf ) ...@@ -211,7 +211,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
if( b_autoresize ) if( b_autoresize )
{ {
CONNECT( this, askVideoToResize( unsigned int, unsigned int ), CONNECT( this, askVideoToResize( unsigned int, unsigned int ),
videoWidget, SetSizing( unsigned int, unsigned int ) ); this, setVideoSize( unsigned int, unsigned int ) );
CONNECT( videoWidget, sizeChanged( int, int ), CONNECT( videoWidget, sizeChanged( int, int ),
this, resizeStack( int, int ) ); this, resizeStack( int, int ) );
} }
...@@ -589,6 +589,13 @@ void MainInterface::releaseVideoSlot( void ) ...@@ -589,6 +589,13 @@ void MainInterface::releaseVideoSlot( void )
stackCentralOldWidget = bgWidget; 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. /* Slot to change the video always-on-top flag.
* Emit askVideoOnTop() to invoke this from other thread. */ * Emit askVideoOnTop() to invoke this from other thread. */
void MainInterface::setVideoOnTop( bool on_top ) void MainInterface::setVideoOnTop( bool on_top )
...@@ -616,8 +623,7 @@ int MainInterface::controlVideo( int i_query, va_list args ) ...@@ -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_width = va_arg( args, unsigned int );
unsigned int i_height = va_arg( args, unsigned int ); unsigned int i_height = va_arg( args, unsigned int );
if( isFullScreen() || isMaximized() )
showNormal();
emit askVideoToResize( i_width, i_height ); emit askVideoToResize( i_width, i_height );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
...@@ -214,6 +214,7 @@ private slots: ...@@ -214,6 +214,7 @@ private slots:
else resize( size() - stackCentralW->size() + QSize( w, h ) ); else resize( size() - stackCentralW->size() + QSize( w, h ) );
debug(); } debug(); }
void setVideoSize( unsigned int, unsigned int );
void setVideoOnTop( bool ); void setVideoOnTop( bool );
signals: signals:
......
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