]> git.sesse.net Git - vlc/commitdiff
macosx: Make sure makeKeyAndOrderFront doesn't hide and then display the window if...
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 12 Jul 2008 21:19:40 +0000 (23:19 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 12 Jul 2008 21:19:40 +0000 (23:19 +0200)
modules/gui/macosx/embeddedwindow.h
modules/gui/macosx/embeddedwindow.m

index 39da8e9d6b9e670188d9af6978b75397810c3d30..e8e408d0ac3ad50fc954197cac5ca5d06fa02b4e 100644 (file)
@@ -49,6 +49,8 @@
     /* set to yes if we are fullscreen and all animations are over */
     BOOL              b_fullscreen;
     NSRecursiveLock * o_animation_lock;
+
+    BOOL              b_window_is_invisible;
 }
 
 - (void)controlTintChanged;
index d7cd72cc26c29de2c4ec2e237ff8b2954ee9f12c..774e18d016a71a98f7dd542ec2554e92e307609c 100644 (file)
@@ -72,6 +72,7 @@
 
     /* Make sure setVisible: returns NO */
     [self orderOut:self];
+    b_window_is_invisible = YES;
 }
 
 - (void)controlTintChanged
         /* Will release the lock */
         [self hasEndedFullscreen];
 
+        /* Our window is hidden, and might be faded. We need to workaround that, so note it
+         * here */
+        b_window_is_invisible = YES;
+
         CGDisplayFade( token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, NO );
         CGReleaseDisplayFadeReservation( token);
         return;
      * having a window that is faded. We can't have it fade in unless we
      * animate again. */
 
+    if(!b_window_is_invisible)
+    {
+        /* Make sure we don't do it too much */
+        [super makeKeyAndOrderFront: sender];
+        return;
+    }
+
     [super setAlphaValue:0.0f];
     [super makeKeyAndOrderFront: sender];
 
     [anim setFrameRate: 30];
 
     [anim startAnimation];
+    b_window_is_invisible = NO;
+
     /* fullscreenAnimation will be unlocked when animation ends */
 }