Commit 40d199a4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

Keep the authoritative fullscreen status on the playlist

This allows the value to be inherited most cleanly across inputs (if
the video output cannot be recycled anyway). This also enables changing
the fullscreen status in absence of video, just like LibVLC does.
parent 31612911
......@@ -379,11 +379,12 @@ static void RunIntf( intf_thread_t *p_intf )
break;
case GESTURE(UP,LEFT,NONE,NONE):
{
bool val = var_ToggleBool( pl_Get( p_intf ), "fullscreen" );
if( p_sys->p_vout )
{
var_ToggleBool( p_sys->p_vout, "fullscreen" );
}
var_SetBool( p_sys->p_vout, "fullscreen", val );
break;
}
case GESTURE(DOWN,LEFT,NONE,NONE):
/* FIXME: Should close the vout!"*/
......
......@@ -229,15 +229,16 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
case ACTIONID_TOGGLE_FULLSCREEN:
{
vlc_object_t *obj = p_vout ? VLC_OBJECT(p_vout)
: VLC_OBJECT(p_playlist);
var_ToggleBool( obj, "fullscreen" );
bool fs = var_ToggleBool( p_playlist, "fullscreen" );
if( p_vout )
var_SetBool( p_vout, "fullscreen", fs );
break;
}
case ACTIONID_LEAVE_FULLSCREEN:
if( p_vout )
var_SetBool( p_vout, "fullscreen", false );
var_SetBool( p_playlist, "fullscreen", false );
break;
case ACTIONID_ZOOM_QUARTER:
......
......@@ -230,12 +230,12 @@ static void MacroDo( httpd_file_sys_t *p_args,
case MVLC_FULLSCREEN:
if( p_sys->p_input )
{
vout_thread_t *p_vout;
p_vout = input_GetVout( p_sys->p_input );
bool fs = var_ToggleBool( p_sys->p_playlist,
"fullscreen" );
vout_thread_t *p_vout = input_GetVout( p_sys->p_input );
if( p_vout )
{
var_ToggleBool( p_vout, "fullscreen" );
var_SetBool( p_vout, "fullscreen", fs );
vlc_object_release( p_vout );
msg_Dbg( p_intf, "requested fullscreen toggle" );
}
......
......@@ -741,36 +741,27 @@ static void Run( intf_thread_t *p_intf )
{
case 'f':
case 'F':
{
bool fs;
if( !strncasecmp( psz_arg, "on", 2 ) )
var_SetBool( p_playlist, "fullscreen", fs = true );
else if( !strncasecmp( psz_arg, "off", 3 ) )
var_SetBool( p_playlist, "fullscreen", fs = false );
else
fs = var_ToggleBool( p_playlist, "fullscreen" );
if( p_input )
{
vout_thread_t *p_vout = input_GetVout( p_input );
if( p_vout )
{
vlc_value_t val;
bool b_update = false;
var_Get( p_vout, "fullscreen", &val );
val.b_bool = !val.b_bool;
if( !strncmp( psz_arg, "on", 2 )
&& ( val.b_bool == true ) )
{
b_update = true;
val.b_bool = true;
}
else if( !strncmp( psz_arg, "off", 3 )
&& ( val.b_bool == false ) )
{
b_update = true;
val.b_bool = false;
}
else if( strncmp( psz_arg, "off", 3 )
&& strncmp( psz_arg, "on", 2 ) )
b_update = true;
if( b_update ) var_Set( p_vout, "fullscreen", val );
var_SetBool( p_vout, "fullscreen", fs );
vlc_object_release( p_vout );
}
}
break;
}
case 's':
case 'S':
;
......
......@@ -1115,18 +1115,15 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
/* Common control */
case 'f':
{
bool fs = var_ToggleBool( p_playlist, "fullscreen" );
if( p_intf->p_sys->p_input )
{
vout_thread_t *p_vout = inputGetVout( p_intf->p_sys->p_input );
if( p_vout )
{
var_ToggleBool( p_vout, "fullscreen" );
var_SetBool( p_vout, "fullscreen", fs );
vlc_object_release( p_vout );
}
else
{
var_ToggleBool( p_playlist, "fullscreen" );
}
}
i_ret = 0;
break;
......
......@@ -118,10 +118,11 @@ void ActionsManager::play()
*/
void ActionsManager::fullscreen()
{
bool fs = var_ToggleBool( THEPL, "fullscreen" );
vout_thread_t *p_vout = THEMIM->getVout();
if( p_vout)
{
var_ToggleBool( p_vout, "fullscreen" );
var_SetBool( p_vout, "fullscreen", fs );
vlc_object_release( p_vout );
}
}
......
......@@ -219,6 +219,7 @@ static int VideoAutoMenuBuilder( vout_thread_t *p_object,
{
PUSH_INPUTVAR( "video-es" );
PUSH_INPUTVAR( "spu-es" );
#warning This is wrong:
PUSH_VAR( "fullscreen" );
PUSH_VAR( "video-on-top" );
PUSH_VAR( "video-wallpaper" );
......
......@@ -29,15 +29,15 @@
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 )
{
// Switch to fullscreen
var_ToggleBool( pVout, "fullscreen" );
// Switch fullscreen
var_SetBool( pVout, "fullscreen", fs );
vlc_object_release( pVout );
}
}
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