Skip to content
Snippets Groups Projects
Commit eafbf0c6 authored by Fatih Uzunoğlu's avatar Fatih Uzunoğlu Committed by Steve Lhomme
Browse files

qt: do not resize the interface during state changes with `qt-video-autoresize`

Otherwise leaving full screen would "forget" the old overridden size.
parent 9945c9a6
No related branches found
No related tags found
1 merge request!6594qt: fix `qt-video-autoresize` ill behavior during window state changes
Pipeline #554439 passed with stage
in 12 minutes and 28 seconds
......@@ -62,7 +62,9 @@ void VideoWindowHandler::disable()
void VideoWindowHandler::requestResizeVideo( unsigned i_width, unsigned i_height )
{
emit askVideoToResize( i_width, i_height );
if (!m_window)
return;
emit askVideoToResize( i_width, i_height, m_window->windowStates() );
}
void VideoWindowHandler::requestVideoWindowed( )
......@@ -81,11 +83,24 @@ void VideoWindowHandler::requestVideoState( unsigned i_arg )
emit askVideoOnTop( on_top );
}
void VideoWindowHandler::setVideoSize(unsigned int w, unsigned int h)
void VideoWindowHandler::setVideoSize(unsigned int w, unsigned int h, Qt::WindowStates currentStates)
{
if (!m_window)
return;
Qt::WindowStates states = m_window->windowStates();
// This slot is queued, so by the time it is called
// the window states reflect the final states.
// `qt-video-autoresize` should not apply during state
// transition, that was also the behavior in VLC 3.
// Otherwise, when getting disengaged from fullscreen
// the interface/video would forget its old (overridden)
// size.
// Do not resize when transitioning between states:
if (currentStates != states)
return;
if ((states & (Qt::WindowFullScreen | Qt::WindowMaximized)) == 0)
{
/* Resize video widget to video size, or keep it at the same
......
......@@ -48,13 +48,13 @@ public:
void requestVideoFullScreen( const char * );
signals:
void askVideoToResize( unsigned int, unsigned int );
void askVideoToResize( unsigned int, unsigned int, Qt::WindowStates );
void askVideoSetFullScreen( bool );
void askVideoOnTop( bool );
protected slots:
/* Manage the Video Functions from the vout threads */
void setVideoSize(unsigned int w, unsigned int h);
void setVideoSize(unsigned int w, unsigned int h, Qt::WindowStates states );
virtual void setVideoFullScreen( bool );
void setVideoOnTop( bool );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment