Commit fee55b88 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

Mac OS X gui: Make sure we don't see a ghost window in expose.

parent 476a2664
...@@ -67,6 +67,8 @@ ...@@ -67,6 +67,8 @@
- (void)enterFullscreen; - (void)enterFullscreen;
- (void)leaveFullscreen; - (void)leaveFullscreen;
/* Allows to leave fullscreen by simply fading out the display */
- (void)leaveFullscreenAndFadeOut: (BOOL)fadeout;
/* private */ /* private */
- (void)hasEndedFullscreen; - (void)hasEndedFullscreen;
......
...@@ -249,6 +249,8 @@ ...@@ -249,6 +249,8 @@
/* We are in fullscreen (and no animation is running) */ /* We are in fullscreen (and no animation is running) */
if (b_fullscreen) if (b_fullscreen)
{ {
/* Make sure we are hidden */
[super orderOut: self];
b_animation_lock_alreadylocked = NO; b_animation_lock_alreadylocked = NO;
[self unlockFullscreenAnimation]; [self unlockFullscreenAnimation];
return; return;
...@@ -319,12 +321,19 @@ ...@@ -319,12 +321,19 @@
/* tell the fspanel to move itself to front next time it's triggered */ /* tell the fspanel to move itself to front next time it's triggered */
[[[[VLCMain sharedInstance] getControls] getFSPanel] setVoutWasUpdated: (int)[[o_fullscreen_window screen] displayID]]; [[[[VLCMain sharedInstance] getControls] getFSPanel] setVoutWasUpdated: (int)[[o_fullscreen_window screen] displayID]];
[super orderOut: self];
[[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil]; [[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil];
b_fullscreen = YES; b_fullscreen = YES;
[self unlockFullscreenAnimation]; [self unlockFullscreenAnimation];
} }
- (void)leaveFullscreen - (void)leaveFullscreen
{
[self leaveFullscreenAndFadeOut: NO];
}
- (void)leaveFullscreenAndFadeOut: (BOOL)fadeout
{ {
NSMutableDictionary *dict1, *dict2; NSMutableDictionary *dict1, *dict2;
NSRect frame; NSRect frame;
...@@ -345,7 +354,7 @@ ...@@ -345,7 +354,7 @@
return; 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 /* 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 * Mac OS X <10.4 which doesn't support NSAnimation, instead we
...@@ -366,6 +375,9 @@ ...@@ -366,6 +375,9 @@
return; return;
} }
[self setAlphaValue: 0.0];
[self orderFront: self];
[[[[VLCMain sharedInstance] getControls] getFSPanel] setNonActive: nil]; [[[[VLCMain sharedInstance] getControls] getFSPanel] setNonActive: nil];
SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar); SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
...@@ -473,7 +485,7 @@ ...@@ -473,7 +485,7 @@
{ {
[super orderOut: sender]; [super orderOut: sender];
/* Make sure we leave fullscreen */ /* Make sure we leave fullscreen */
[self leaveFullscreen]; [self leaveFullscreenAndFadeOut: YES];
} }
/* Make sure setFrame gets executed on main thread especially if we are animating. /* Make sure setFrame gets executed on main thread especially if we are animating.
......
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