+ resize( w, h );
+ emit sizeChanged( w, h );
+ /* Work-around a bug?misconception? that would happen when vout core resize
+ twice to the same size and would make the vout not centered.
+ This cause a small flicker.
+ See #3621
+ */
+ if( size().width() == w && size().height() == h )
+ updateGeometry();
+ videoSync();
+}
+
+void VideoWidget::SetFullScreen( bool b_fs )
+{
+ const Qt::WindowStates curstate = reparentable->windowState();
+ Qt::WindowStates newstate = curstate;
+ Qt::WindowFlags newflags = reparentable->windowFlags();
+
+
+ if( b_fs )
+ {
+ newstate |= Qt::WindowFullScreen;
+ newflags |= Qt::WindowStaysOnTopHint;
+ }
+ else
+ {
+ newstate &= ~Qt::WindowFullScreen;
+ newflags &= ~Qt::WindowStaysOnTopHint;
+ }
+ if( newstate == curstate )
+ return; /* no changes needed */
+
+ if( b_fs )
+ { /* Go full-screen */
+ int numscreen = var_InheritInteger( p_intf, "qt-fullscreen-screennumber" );
+ /* if user hasn't defined screennumber, or screennumber that is bigger
+ * than current number of screens, take screennumber where current interface
+ * is
+ */
+ if( numscreen == -1 || numscreen > QApplication::desktop()->numScreens() )
+ numscreen = QApplication::desktop()->screenNumber( p_intf->p_sys->p_mi );
+
+ QRect screenres = QApplication::desktop()->screenGeometry( numscreen );
+
+ /* To be sure window is on proper-screen in xinerama */
+ if( !screenres.contains( reparentable->pos() ) )
+ {
+ msg_Dbg( p_intf, "Moving video to correct screen");
+ reparentable->move( QPoint( screenres.x(), screenres.y() ) );
+ }
+ reparentable->setParent( NULL, newflags );
+ reparentable->setWindowState( newstate );
+
+ /* FIXME: inherit from the vout window, not the interface */
+ char *title = var_InheritString( p_intf, "video-title" );
+ reparentable->setWindowTitle( qfu(title ? title : _("Video")) );
+ free( title );
+
+ reparentable->show();
+ }
+ else
+ { /* Go windowed */
+ reparentable->setWindowFlags( newflags );
+ reparentable->setWindowState( newstate );
+ layout->addWidget( reparentable );
+ }
+ videoSync();