}
case ACTIONID_LEAVE_FULLSCREEN:
- if( p_vout && var_GetBool( p_vout, "fullscreen" ) )
+ if( p_vout )
var_SetBool( p_vout, "fullscreen", false );
break;
return var_Set( p_dst, psz_var, newval );
}
-/**
- * Internal helper to forward fullscreen event from p_this to p_data.
- */
-static inline int ForwardFullscreen( vlc_object_t *p_this, char const *psz_var,
- vlc_value_t oldval, vlc_value_t newval, void *p_data )
-{
- VLC_UNUSED(p_this); VLC_UNUSED(oldval);
- vlc_object_t *p_dst = (vlc_object_t*)p_data;
-
- if( !var_GetBool( p_dst, "fullscreen" ) != !newval.b_bool )
- return var_SetBool( p_dst, psz_var, newval.b_bool );
- return VLC_SUCCESS;
-}
/**
* Install/remove all callbacks needed for proper event handling inside
* a vout-filter.
/* */
if( !pf_fullscreen_up )
- pf_fullscreen_up = ForwardFullscreen;
+ pf_fullscreen_up = ForwardEvent;
if( !pf_fullscreen_down )
- pf_fullscreen_down = ForwardFullscreen;
+ pf_fullscreen_down = ForwardEvent;
pf_execute( VLC_OBJECT(p_child), "fullscreen", pf_fullscreen_up, p_parent );
pf_execute( VLC_OBJECT(p_parent), "fullscreen", pf_fullscreen_down, p_child );
}
VLC_UNUSED(oldval); VLC_UNUSED(p_this); VLC_UNUSED(psz_var); VLC_UNUSED(newval);
const bool b_fullscreen = IsFullscreenActive( p_vout );
- if( !var_GetBool( p_vout, "fullscreen" ) != !b_fullscreen )
- return var_SetBool( p_vout, "fullscreen", b_fullscreen );
- return VLC_SUCCESS;
+ return var_SetBool( p_vout, "fullscreen", b_fullscreen );
}
static int FullscreenEventDown( vlc_object_t *p_this, char const *psz_var,
vlc_value_t oldval, vlc_value_t newval, void *p_data )
vout_sys_t *p_sys = p_vout->p_sys;
VLC_UNUSED(oldval); VLC_UNUSED(p_data); VLC_UNUSED(psz_var);
- const bool b_fullscreen = IsFullscreenActive( p_vout );
- if( !b_fullscreen != !newval.b_bool )
+ for( int i = 0; i < p_sys->i_vout; i++ )
{
- for( int i = 0; i < p_sys->i_vout; i++ )
- {
- vout_thread_t *p_child = p_sys->pp_vout[i];
- if( !var_GetBool( p_child, "fullscreen" ) != !newval.b_bool )
- {
- var_SetBool( p_child, "fullscreen", newval.b_bool );
- if( newval.b_bool )
- return VLC_SUCCESS;
- }
- }
+ vout_thread_t *p_child = p_sys->pp_vout[i];
+ var_SetBool( p_child, "fullscreen", newval.b_bool );
}
return VLC_SUCCESS;
}
static inline void vout_SendEventFullscreen(vout_thread_t *vout, bool is_fullscreen)
{
- if (!var_GetBool(vout, "fullscreen") != !is_fullscreen)
- var_SetBool(vout, "fullscreen", is_fullscreen);
+ var_SetBool(vout, "fullscreen", is_fullscreen);
}
static inline void vout_SendEventDisplayFilled(vout_thread_t *vout, bool is_display_filled)
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
vlc_value_t val;
- (void)psz_cmd; (void)oldval; (void)p_data;
+ (void)psz_cmd; (void)p_data;
+ if( oldval.b_bool == newval.b_bool )
+ return VLC_SUCCESS; /* no-op */
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
/* Modify libvlc as well because the vout might have to be restarted */