Commit e9878b8b authored by Benoît Noël du Payrat's avatar Benoît Noël du Payrat Committed by Jean-Baptiste Kempf

Qt: prevents the window from resizing to its current size

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 15bca57c
......@@ -183,6 +183,16 @@ WId VideoWidget::request( struct vout_window_t *p_wnd, unsigned int *pi_width,
Parent has to care about resizing itself */
void VideoWidget::setSize( unsigned int w, unsigned int h )
{
/* If the size changed, resizeEvent will be called, otherwise not,
* in which case we need to tell the vout what the size actually is
*/
if( (unsigned)size().width() == w && (unsigned)size().height() == h )
{
if( p_window != NULL )
vout_window_ReportSize( p_window, w, h );
return;
}
resize( w, h );
emit sizeChanged( w, h );
/* Work-around a bug?misconception? that would happen when vout core resize
......
......@@ -215,11 +215,12 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
{
if( b_autoresize )
{
CONNECT( this, askVideoToResize( unsigned int, unsigned int ),
this, setVideoSize( unsigned int, unsigned int ) );
CONNECT( videoWidget, sizeChanged( int, int ),
this, videoSizeChanged( int, int ) );
}
CONNECT( this, askVideoToResize( unsigned int, unsigned int ),
this, setVideoSize( unsigned int, unsigned int ) );
CONNECT( this, askVideoSetFullScreen( bool ),
this, setVideoFullScreen( bool ) );
}
......@@ -777,8 +778,17 @@ void MainInterface::releaseVideoSlot( void )
void MainInterface::setVideoSize( unsigned int w, unsigned int h )
{
if( !isFullScreen() && !isMaximized() )
videoWidget->setSize( w, h );
if (!isFullScreen() && !isMaximized() )
{
/* Resize video widget to video size, or keep it at the same
* size. Call setSize() either way so that vout_window_ReportSize
* will always get called.
*/
if (b_autoresize)
videoWidget->setSize( w, h );
else
videoWidget->setSize( videoWidget->width(), videoWidget->height() );
}
}
void MainInterface::videoSizeChanged( int w, int h )
......
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