[vlc-devel] Regarding VLC + Xfce Fullscreen

Rémi Denis-Courmont remi at remlab.net
Fri Mar 1 16:39:13 CET 2013


Le vendredi 1 mars 2013 16:28:57, Jogy Antony a écrit :
> On Thu, Feb 28, 2013 at 9:00 PM, Rémi Denis-Courmont <remi at remlab.net> 
wrote:
> > Le jeudi 28 février 2013 15:40:00, Jogy Antony a écrit :
> >> QT stores the windowstate as a bitmap, maximized and fullscreen being
> >> the important windowstates. VLC attempts to go fullscreen like this :
> >> 
> >> setWindowState( windowState() | Qt::WindowFullScreen );
> >> 
> >> This is unfortunate, since if the windowState was already maximized,
> >> this will set it maxmized _and_ fullscreen.
> > 
> > No. It will set fullscreen and leaves the other bits untouched. That
> > seems correct
> 
> Clearly you can see that Qt folks disagree.

Actually, no, I cannot see that.

> From http://mailman.videolan.org/pipermail/vlc-devel/2012-May/088372.html
> 
> >But in any case, VLC does not touch the maximized bits.
> 
> Atleast for Linux this is not true.

Woth current VLC on KDE, it *is* true, as manually verified with xprop and 
xtrace.

(...)
> 
> diff --git a/modules/gui/qt4/main_interface.cpp
> b/modules/gui/qt4/main_interface.cpp
> index 2f2ca1a..3f7db0c 100644
> --- a/modules/gui/qt4/main_interface.cpp
> +++ b/modules/gui/qt4/main_interface.cpp
> @@ -259,6 +259,7 @@ MainInterface::MainInterface( intf_thread_t
> *_p_intf ) : QVLCMW( _p_intf )
>      /* Switch to minimal view if needed, must be called after the show()
> */ if( b_minimalView )
>          toggleMinimalView( true );
> +    stateBeforeFullScreen = windowState();
>  }
> 
>  MainInterface::~MainInterface()
> @@ -1413,10 +1414,14 @@ void MainInterface::toolBarConfUpdated()
> 
>  void MainInterface::setInterfaceFullScreen( bool fs )
>  {
> -    if( fs )
> -        setWindowState( windowState() | Qt::WindowFullScreen );
> -    else
> -        setWindowState( windowState() & ~Qt::WindowFullScreen );
> +    if( fs ) {
> +      stateBeforeFullScreen = windowState();
> +      setWindowState((windowState() & ~(Qt::WindowMinimized |
> Qt::WindowMaximized)) | Qt::WindowFullScreen);
> +    }
> +    else {
> +      showNormal();
> +      setWindowState(stateBeforeFullScreen);

This will glitch from fullscreen to normal then to maximized. The expected 
behaviour consists of switching straight from fullscreen to maximized.

> +    }
>  }
>  void MainInterface::toggleInterfaceFullScreen()
>  {
> diff --git a/modules/gui/qt4/main_interface.hpp
> b/modules/gui/qt4/main_interface.hpp
> index 4c5b1fd..c3e1b16 100644
> --- a/modules/gui/qt4/main_interface.hpp
> +++ b/modules/gui/qt4/main_interface.hpp
> @@ -173,6 +173,7 @@ private:
> 
>      bool                 b_hasPausedWhenMinimized;
>      bool                 b_statusbarVisible;
> +    Qt::WindowStates     stateBeforeFullScreen;  ///< The window
> state before switching to fullscreen

This needlessly duplicates state that is already stored in EWMH window 
properties in the form of X11 atoms.

> 
>  #ifdef WIN32
>      HIMAGELIST himl;
> 
> Thanks
> Joji Antony
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list