- CGDisplayFadeReservationToken token;
- NSRect screen_rect = [o_screen frame];
- screen_rect.origin.x = screen_rect.origin.y = 0;
-
- /* 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] )
- [[[[VLCMain sharedInstance] getControls] getFSPanel] orderFront: self];
-
- /* tell the fspanel to move itself to front next time it's triggered */
- [[[[VLCMain sharedInstance] getControls] getFSPanel] setVoutWasUpdated: i_device];
-
- /* Creates a window with size: screen_rect on o_screen */
- [self initWithContentRect: screen_rect
- styleMask: NSBorderlessWindowMask
- backing: NSBackingStoreBuffered
- defer: YES screen: o_screen];
-
- if( b_black == VLC_TRUE )
- {
- CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token);
- CGDisplayFade( token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, true );
- CGReleaseDisplayFadeReservation( token );
- unsigned int i;
- for( i = 0 ; i < [o_screens count]; i++)
- {
- struct
- {
- CGDirectDisplayID displayID;
- CGGammaValue redMin, redMax, redGamma,
- greenMin, greenMax, greenGamma,
- blueMin, blueMax, blueGamma;
- } dispSettings;
- CGDisplayCount dspyCnt;
- CGPoint gPoint;
-
- if( i == (unsigned int)i_device ) continue;
-
- screen_rect = [[o_screens objectAtIndex: i] frame];
-
- gPoint.x = screen_rect.origin.x;
- gPoint.y = screen_rect.origin.y;
- CGGetDisplaysWithPoint( gPoint, 1, &(dispSettings.displayID), &dspyCnt);
- CGGetDisplayTransferByFormula(
- dispSettings.displayID,
- &dispSettings.redMin, &dispSettings.redMax, &dispSettings.redGamma,
- &dispSettings.greenMin, &dispSettings.greenMax, &dispSettings.greenGamma,
- &dispSettings.blueMin, &dispSettings.blueMax, &dispSettings.blueGamma );
- CGSetDisplayTransferByFormula(
- dispSettings.displayID,
- dispSettings.redMin, 0, dispSettings.redGamma,
- dispSettings.greenMin, 0, dispSettings.greenGamma,
- dispSettings.blueMin, 0, dispSettings.blueGamma );
- }
- }
- if( b_menubar_screen )
+ [self setBackgroundColor:[NSColor blackColor]];
+ [self setHasShadow:YES];
+ [self setMovableByWindowBackground: YES];
+ [self center];
+ [self makeKeyAndOrderFront: self];
+ [self setReleasedWhenClosed: YES];
+ [self setFrameUsingName:@"VLCVoutWindowDetached"];
+ [self setFrameAutosaveName:@"VLCVoutWindowDetached"];
+
+ /* We'll catch mouse events */
+ [self makeFirstResponder: o_view];
+ [self setCanBecomeKeyWindow: YES];
+ [self setAcceptsMouseMovedEvents: YES];
+ [self setIgnoresMouseEvents: NO];
+
+ if( var_CreateGetBool( p_vout, "macosx-background" ) )