Commit b0133e48 authored by Damien Fouilleul's avatar Damien Fouilleul

vout.m: change in fullscreen behaviour

- toggle fullscreen mode when double clicking on video.
- allow menu autoshow/autohide when moving cursor in or out the menu area while in fullscreen mode
parent 956087a8
...@@ -119,7 +119,6 @@ ...@@ -119,7 +119,6 @@
NSRect * s_frame; NSRect * s_frame;
vout_thread_t * p_real_vout; vout_thread_t * p_real_vout;
Ptr p_fullscreen_state;
vlc_bool_t b_init_ok; vlc_bool_t b_init_ok;
vlc_bool_t b_black; vlc_bool_t b_black;
} }
......
...@@ -460,9 +460,18 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -460,9 +460,18 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
{ {
case NSLeftMouseDown: case NSLeftMouseDown:
{ {
var_Get( p_vout, "mouse-button-down", &val ); if( [o_event clickCount] <= 1 )
val.i_int |= 1; {
var_Set( p_vout, "mouse-button-down", val ); /* single clicking */
var_Get( p_vout, "mouse-button-down", &val );
val.i_int |= 1;
var_Set( p_vout, "mouse-button-down", val );
}
else
{
/* multiple clicking */
[self toggleFullscreen];
}
} }
break; break;
...@@ -949,7 +958,6 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -949,7 +958,6 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
b_init_ok = VLC_FALSE; b_init_ok = VLC_FALSE;
p_fullscreen_state = NULL;
p_real_vout = [VLCVoutView getRealVout: p_vout]; p_real_vout = [VLCVoutView getRealVout: p_vout];
i_device = var_GetInteger( p_real_vout->p_vlc, "video-device" ); i_device = var_GetInteger( p_real_vout->p_vlc, "video-device" );
b_black = var_GetBool( p_real_vout->p_vlc, "macosx-black" ); b_black = var_GetBool( p_real_vout->p_vlc, "macosx-black" );
...@@ -1022,8 +1030,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -1022,8 +1030,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
} }
if( b_menubar_screen ) if( b_menubar_screen )
{ {
BeginFullScreen( &p_fullscreen_state, NULL, 0, 0, SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
NULL, NULL, fullScreenAllowEvents );
} }
if( b_black == VLC_TRUE ) if( b_black == VLC_TRUE )
{ {
...@@ -1107,8 +1114,6 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -1107,8 +1114,6 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
- (id) closeReal: (id) sender - (id) closeReal: (id) sender
{ {
if( p_fullscreen_state )
EndFullScreen( p_fullscreen_state, 0 );
if( b_black == VLC_TRUE ) if( b_black == VLC_TRUE )
{ {
CGDisplayFadeReservationToken token; CGDisplayFadeReservationToken token;
...@@ -1117,6 +1122,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, ...@@ -1117,6 +1122,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
CGReleaseDisplayFadeReservation( token); CGReleaseDisplayFadeReservation( token);
CGDisplayRestoreColorSyncSettings(); CGDisplayRestoreColorSyncSettings();
} }
SetSystemUIMode( kUIModeNormal, 0);
[super close]; [super close];
return NULL; return NULL;
} }
......
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