X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fmacosx%2Fvout.m;h=6be49cc14fa6a5b51c2e9a80d6ef25ae273c3d27;hb=6d1c28b3c74828f7810301f3dadd41d89e326ccb;hp=c1fdc381375ad76e63fd381661b9ce14be2e07a3;hpb=a71707c146ff23f6bf5ef88d51ffadd5437ad1ff;p=vlc diff --git a/modules/gui/macosx/vout.m b/modules/gui/macosx/vout.m index c1fdc38137..6be49cc14f 100644 --- a/modules/gui/macosx/vout.m +++ b/modules/gui/macosx/vout.m @@ -460,9 +460,18 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, { case NSLeftMouseDown: { - var_Get( p_vout, "mouse-button-down", &val ); - val.i_int |= 1; - var_Set( p_vout, "mouse-button-down", val ); + if( [o_event clickCount] <= 1 ) + { + /* 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; @@ -772,6 +781,13 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, frame: s_arg_frame]; [self updateTitle]; [view setFrame: [self frame]]; + + if( var_GetBool( p_real_vout, "video-on-top" ) ) + { + [o_window setLevel: NSStatusWindowLevel]; + } + + [o_window setAcceptsMouseMovedEvents: TRUE]; return b_return; } @@ -853,6 +869,12 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, o_window = [self window]; [o_window makeKeyAndOrderFront: self]; [o_window setAcceptsMouseMovedEvents: TRUE]; + + if( var_GetBool( p_real_vout, "video-on-top" ) ) + { + [o_window setLevel: NSStatusWindowLevel]; + } + [view setFrameSize: [self frame].size]; } return b_return; @@ -936,7 +958,6 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, b_init_ok = VLC_FALSE; - p_fullscreen_state = NULL; p_real_vout = [VLCVoutView getRealVout: p_vout]; i_device = var_GetInteger( p_real_vout->p_vlc, "video-device" ); b_black = var_GetBool( p_real_vout->p_vlc, "macosx-black" ); @@ -1009,8 +1030,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, } if( b_menubar_screen ) { - BeginFullScreen( &p_fullscreen_state, NULL, 0, 0, - NULL, NULL, fullScreenAllowEvents ); + SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar); } if( b_black == VLC_TRUE ) { @@ -1057,11 +1077,6 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, [self setAlphaValue: var_GetFloat( p_vout, "macosx-opaqueness" )]; - if( var_GetBool( p_real_vout, "video-on-top" ) ) - { - [self setLevel: NSStatusWindowLevel]; - } - if( !s_frame ) { [self center]; @@ -1099,8 +1114,6 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, - (id) closeReal: (id) sender { - if( p_fullscreen_state ) - EndFullScreen( p_fullscreen_state, 0 ); if( b_black == VLC_TRUE ) { CGDisplayFadeReservationToken token; @@ -1109,6 +1122,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, CGReleaseDisplayFadeReservation( token); CGDisplayRestoreColorSyncSettings(); } + SetSystemUIMode( kUIModeNormal, 0); [super close]; return NULL; }