[vlc-commits] skins2: improve fullscreen behaviour

Erwan Tulou git at videolan.org
Sat Jun 22 13:08:46 CEST 2013


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Sat Jun 22 02:07:00 2013 +0200| [7b5250473ca12e6a806a128441a39e7a417c8ba2] | committer: Erwan Tulou

skins2: improve fullscreen behaviour

At the core level, the 'f' hotkey and the double click are managed in a
slightly different way. The former sets up both the playlist and the vout
"fullscreen" variables whereas the latter only sets up the vout variable.

This patch first relies on the vout state if any, and falls back to the
playlist state. This ensures that the fullscreen button always works
consistently for the user. Otherwise, user needs to press twice instead
of once when the playlist and the vout are no longer in sync (after a double
click)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7b5250473ca12e6a806a128441a39e7a417c8ba2
---

 modules/gui/skins2/commands/cmd_fullscreen.cpp |   25 +++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/modules/gui/skins2/commands/cmd_fullscreen.cpp b/modules/gui/skins2/commands/cmd_fullscreen.cpp
index a2ef8f9..7dcfe79 100644
--- a/modules/gui/skins2/commands/cmd_fullscreen.cpp
+++ b/modules/gui/skins2/commands/cmd_fullscreen.cpp
@@ -30,15 +30,22 @@
 
 void CmdFullscreen::execute()
 {
-    bool fs = var_ToggleBool( pl_Get( getIntf() ), "fullscreen" );
-
-    if( getIntf()->p_sys->p_input == NULL )
-        return;
-    vout_thread_t *pVout = input_GetVout( getIntf()->p_sys->p_input );
-    if( pVout )
+    bool fs;
+    bool hasVout = false;
+    if( getIntf()->p_sys->p_input != NULL )
     {
-        // Switch fullscreen
-        var_SetBool( pVout, "fullscreen", fs );
-        vlc_object_release( pVout );
+        vout_thread_t *pVout = input_GetVout( getIntf()->p_sys->p_input );
+        if( pVout )
+        {
+            // Toggle fullscreen
+            fs = var_ToggleBool( pVout, "fullscreen" );
+            vlc_object_release( pVout );
+            hasVout = true;
+        }
     }
+
+    if( hasVout )
+        var_SetBool( pl_Get( getIntf() ), "fullscreen", fs );
+    else
+        var_ToggleBool( pl_Get( getIntf() ), "fullscreen" );
 }



More information about the vlc-commits mailing list