Commit 644a03b1 authored by Laurent Aimar's avatar Laurent Aimar

Forced "on top" to the video widget in Qt4 while in fullscreen.

There is still a problem when the Gui itself has "on top" set.
parent ad8f9a79
...@@ -158,11 +158,18 @@ void VideoWidget::SetFullScreen( bool b_fs ) ...@@ -158,11 +158,18 @@ void VideoWidget::SetFullScreen( bool b_fs )
{ {
const Qt::WindowStates curstate = reparentable->windowState(); const Qt::WindowStates curstate = reparentable->windowState();
Qt::WindowStates newstate = curstate; Qt::WindowStates newstate = curstate;
Qt::WindowFlags newflags = reparentable->windowFlags();
if( b_fs ) if( b_fs )
{
newstate |= Qt::WindowFullScreen; newstate |= Qt::WindowFullScreen;
newflags |= Qt::WindowStaysOnTopHint;
}
else else
{
newstate &= ~Qt::WindowFullScreen; newstate &= ~Qt::WindowFullScreen;
newflags &= ~Qt::WindowStaysOnTopHint;
}
if( newstate == curstate ) if( newstate == curstate )
return; /* no changes needed */ return; /* no changes needed */
...@@ -170,10 +177,12 @@ void VideoWidget::SetFullScreen( bool b_fs ) ...@@ -170,10 +177,12 @@ void VideoWidget::SetFullScreen( bool b_fs )
{ /* Go full-screen */ { /* Go full-screen */
reparentable->setWindowState( newstate ); reparentable->setWindowState( newstate );
reparentable->setParent( NULL ); reparentable->setParent( NULL );
reparentable->setWindowFlags( newflags );
reparentable->show(); reparentable->show();
} }
else else
{ /* Go windowed */ { /* Go windowed */
reparentable->setWindowFlags( newflags );
layout->addWidget( reparentable ); layout->addWidget( reparentable );
reparentable->setWindowState( newstate ); reparentable->setWindowState( newstate );
} }
......
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