]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/vout.m
* implement the error panel correctly (for the records: not < 10.3 compatible)
[vlc] / modules / gui / macosx / vout.m
index e07a57d3ecf911fb161dd003b6f3d1468097268d..6be49cc14fa6a5b51c2e9a80d6ef25ae273c3d27 100644 (file)
@@ -358,6 +358,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
 {
     vlc_value_t val;
 
+    if( !p_real_vout ) return;
     if( var_Get( p_real_vout, "video-on-top", &val )>=0 && val.b_bool)
     {
         val.b_bool = VLC_FALSE;
@@ -372,6 +373,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
 - (void)toggleFullscreen
 {
     vlc_value_t val;
+    if( !p_real_vout ) return;
     var_Get( p_real_vout, "fullscreen", &val );
     val.b_bool = !val.b_bool;
     var_Set( p_real_vout, "fullscreen", val );
@@ -425,7 +427,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
         /* Escape should always get you out of fullscreen */
         if( key == (unichar) 0x1b )
         {
-             if( [self isFullscreen] )
+             if( p_real_vout && [self isFullscreen] )
              {
                  [self toggleFullscreen];
              }
@@ -458,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;
 
@@ -770,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;
 }
@@ -851,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;
@@ -934,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" );
@@ -1007,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 )
         {
@@ -1055,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];
@@ -1097,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;
@@ -1107,6 +1122,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
         CGReleaseDisplayFadeReservation( token);
         CGDisplayRestoreColorSyncSettings();
     }
+    SetSystemUIMode( kUIModeNormal, 0);
     [super close];
     return NULL;
 }