]> git.sesse.net Git - vlc/commitdiff
Mac OS X gui: Make sure we don't see a ghost window in expose.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 11 May 2007 09:11:36 +0000 (09:11 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 11 May 2007 09:11:36 +0000 (09:11 +0000)
modules/gui/macosx/embeddedwindow.h
modules/gui/macosx/embeddedwindow.m

index e541fa2ca8a0f74db904f89e96a816429473056f..9831cb0971023269013f7219e3ffeebf0fcf4e3c 100644 (file)
@@ -67,6 +67,8 @@
 
 - (void)enterFullscreen;
 - (void)leaveFullscreen;
+/* Allows to leave fullscreen by simply fading out the display */
+- (void)leaveFullscreenAndFadeOut: (BOOL)fadeout;
 
 /* private */
 - (void)hasEndedFullscreen;
index e047c701b44eb371b6ce136b51ffb7decb233be9..ee71da2a3e0752cd508f2039587f0744034f7d55 100644 (file)
     /* We are in fullscreen (and no animation is running) */
     if (b_fullscreen)
     {
+        /* Make sure we are hidden */
+        [super orderOut: self];
         b_animation_lock_alreadylocked = NO;
         [self unlockFullscreenAnimation];
         return;
     /* tell the fspanel to move itself to front next time it's triggered */
     [[[[VLCMain sharedInstance] getControls] getFSPanel] setVoutWasUpdated: (int)[[o_fullscreen_window screen] displayID]];
     
+    [super orderOut: self];
+
     [[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil];
     b_fullscreen = YES;
     [self unlockFullscreenAnimation];
 }
 
 - (void)leaveFullscreen
+{
+    [self leaveFullscreenAndFadeOut: NO];
+}
+
+- (void)leaveFullscreenAndFadeOut: (BOOL)fadeout
 {
     NSMutableDictionary *dict1, *dict2;
     NSRect frame;
         return;
     }
 
-    if (![self isVisible] || MACOS_VERSION < 10.4f)
+    if (fadeout || MACOS_VERSION < 10.4f)
     {
         /* We don't animate if we are not visible or if we are running on
         * Mac OS X <10.4 which doesn't support NSAnimation, instead we
         return;
     }
 
+    [self setAlphaValue: 0.0];
+    [self orderFront: self];
+
     [[[[VLCMain sharedInstance] getControls] getFSPanel] setNonActive: nil];
     SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
 
 {
     [super orderOut: sender];
     /* Make sure we leave fullscreen */
-    [self leaveFullscreen];
+    [self leaveFullscreenAndFadeOut: YES];
 }
 
 /* Make sure setFrame gets executed on main thread especially if we are animating.