for(i = 0; i < [[NSScreen screens] count]; i++)
{
- VLCWindow *blackoutWindow;
NSScreen *screen = [[NSScreen screens] objectAtIndex: i];
+ VLCWindow *blackoutWindow;
+ NSRect screen_rect;
+
if([self isScreen: screen])
continue;
+
+ screen_rect = [screen frame];
+ screen_rect.origin.x = screen_rect.origin.y = 0.0f;
+
/* blackoutWindow alloc strategy
- The NSMutableArray blackoutWindows has the blackoutWindow references
- blackoutOtherDisplays is responsible for alloc/releasing its Windows
*/
- blackoutWindow = [[VLCWindow alloc] initWithContentRect: [screen frame] styleMask: NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
+ blackoutWindow = [[VLCWindow alloc] initWithContentRect: screen_rect styleMask: NSBorderlessWindowMask
+ backing: NSBackingStoreBuffered defer: NO screen: screen];
[blackoutWindow setBackgroundColor:[NSColor blackColor]];
[blackoutWindow setLevel: NSFloatingWindowLevel]; /* Disappear when Expose is triggered */
p_real_vout = [VLCVoutView getRealVout: p_vout];
i_device = var_GetInteger( p_real_vout->p_libvlc, "video-device" );
- b_black = var_GetBool( p_vout, "macosx-black" );
+ b_black = NO;
b_embedded = var_GetBool( p_vout, "macosx-embedded" );
/* Find out on which screen to open the window */
NSRect screen_rect = [o_screen frame];
screen_rect.origin.x = screen_rect.origin.y = 0;
+ b_black = var_GetBool( p_vout, "macosx-black" );
+
/* move the FSPanel to front in case that it is currently shown
* this won't and is not supposed to work when it's fading right now */
if( [[[[VLCMain sharedInstance] getControls] getFSPanel] isDisplayed] )
backing: NSBackingStoreBuffered
defer: YES screen: o_screen];
- if( b_black == VLC_TRUE )
- [o_screen blackoutOtherScreens];
-
if( b_menubar_screen )
{
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
if( b_black == VLC_TRUE )
{
CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token);
- CGDisplayFade( token, 2 , kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, false );
+ CGDisplayFade( token, 0.6 , kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
+
+ [o_screen blackoutOtherScreens];
+
+ CGDisplayFade( token, 0.3 , kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, NO );
CGReleaseDisplayFadeReservation( token);
}
}
{
/* XXX waitUntilDone = NO to avoid a possible deadlock when hitting
Command-Q */
- [self setContentView: NULL];
[self performSelectorOnMainThread: @selector(closeReal:)
withObject: NULL waitUntilDone: NO];
}
- (id)closeReal:(id)sender
{
- [NSScreen unblackoutScreens];
if( b_black == VLC_TRUE )
{
CGDisplayFadeReservationToken token;
CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token);
- CGDisplayFade( token, 2, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, false );
+ CGDisplayFade( token, 0.3 , kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
+
+ [self disableScreenUpdatesUntilFlush];
+ [self orderOut: self];
+
+ CGDisplayFade( token, 0.6 , kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, YES );
CGReleaseDisplayFadeReservation( token);
CGDisplayRestoreColorSyncSettings();
}
+ [NSScreen unblackoutScreens];
+
SetSystemUIMode( kUIModeNormal, 0);
[super close];
/* this does only work in embedded mode */