- CGDisplayFadeReservationToken token;
- 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] )
- [[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil];
-
- /* 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_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" ) )