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 )
if( b_autoresize )
{
CONNECT( this, askVideoToResize( unsigned int, unsigned int ),
videoWidget, SetSizing( unsigned int, unsigned int ) );
this, setVideoSize( unsigned int, unsigned int ) );
CONNECT( videoWidget, sizeChanged( int, int ),
this, resizeStack( int, int ) );
}
......@@ -589,6 +589,13 @@ void MainInterface::releaseVideoSlot( void )
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.
* Emit askVideoOnTop() to invoke this from other thread. */
void MainInterface::setVideoOnTop( bool on_top )
......@@ -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_height = va_arg( args, unsigned int );
if( isFullScreen() || isMaximized() )
showNormal();
emit askVideoToResize( i_width, i_height );
return VLC_SUCCESS;
}
......
......@@ -214,6 +214,7 @@ private slots:
else resize( size() - stackCentralW->size() + QSize( w, h ) );
debug(); }
void setVideoSize( unsigned int, unsigned int );
void setVideoOnTop( bool );
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