Commit 3cddf245 authored by Ilkka Ollakka's avatar Ilkka Ollakka

Qt4: move fullscreen window on current viewport

This restores functionality, that video goes fullscreen on same screen
that vlc player is. For somereason it didn't work correctly when
reparented to QDesktop-screen( num ) widget.
parent 87720524
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <QDate> #include <QDate>
#include <QMenu> #include <QMenu>
#include <QWidgetAction> #include <QWidgetAction>
#include <QDesktopWidget>
#ifdef Q_WS_X11 #ifdef Q_WS_X11
# include <X11/Xlib.h> # include <X11/Xlib.h>
...@@ -160,6 +161,7 @@ void VideoWidget::SetFullScreen( bool b_fs ) ...@@ -160,6 +161,7 @@ void VideoWidget::SetFullScreen( bool b_fs )
Qt::WindowStates newstate = curstate; Qt::WindowStates newstate = curstate;
Qt::WindowFlags newflags = reparentable->windowFlags(); Qt::WindowFlags newflags = reparentable->windowFlags();
if( b_fs ) if( b_fs )
{ {
newstate |= Qt::WindowFullScreen; newstate |= Qt::WindowFullScreen;
...@@ -175,9 +177,18 @@ void VideoWidget::SetFullScreen( bool b_fs ) ...@@ -175,9 +177,18 @@ void VideoWidget::SetFullScreen( bool b_fs )
if( b_fs ) if( b_fs )
{ /* Go full-screen */ { /* Go full-screen */
reparentable->setWindowState( newstate ); int numscreen = QApplication::desktop()->screenNumber( p_intf->p_sys->p_mi );
QRect screenres = QApplication::desktop()->screenGeometry( numscreen );
reparentable->setParent( NULL ); reparentable->setParent( NULL );
reparentable->setWindowState( newstate );
reparentable->setWindowFlags( newflags ); reparentable->setWindowFlags( newflags );
/* 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->show(); reparentable->show();
} }
else else
......
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