Commit 834670aa authored by Felix Paul Kühne's avatar Felix Paul Kühne

Fixed 'Blackout screens' on multi-screen setups

parent 982b7c40
/***************************************************************************** /*****************************************************************************
* embeddedwindow.m: MacOS X interface module * embeddedwindow.m: MacOS X interface module
***************************************************************************** *****************************************************************************
* Copyright (C) 2005-2007 the VideoLAN team * Copyright (C) 2005-2008 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Benjamin Pracht <bigben at videolan dot org> * Authors: Benjamin Pracht <bigben at videolan dot org>
* Felix Paul Kühne <fkuehne at videolan dot org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -193,7 +194,7 @@ ...@@ -193,7 +194,7 @@
NSRect screen_rect; NSRect screen_rect;
NSRect rect; NSRect rect;
vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT, FIND_ANYWHERE ); vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
BOOL blackout_other_displays = var_GetBool( p_vout, "macosx-black" ); BOOL blackout_other_displays = config_GetInt( VLCIntf, "macosx-black" );
screen = [NSScreen screenWithDisplayID:(CGDirectDisplayID)var_GetInteger( p_vout, "video-device" )]; screen = [NSScreen screenWithDisplayID:(CGDirectDisplayID)var_GetInteger( p_vout, "video-device" )];
...@@ -213,8 +214,8 @@ ...@@ -213,8 +214,8 @@
[NSCursor setHiddenUntilMouseMoves: YES]; [NSCursor setHiddenUntilMouseMoves: YES];
if (blackout_other_displays) if( blackout_other_displays )
[screen blackoutOtherScreens]; /* We should do something like [screen blackoutOtherScreens]; */ [screen blackoutOtherScreens];
/* Only create the o_fullscreen_window if we are not in the middle of the zooming animation */ /* Only create the o_fullscreen_window if we are not in the middle of the zooming animation */
if (!o_fullscreen_window) if (!o_fullscreen_window)
......
/***************************************************************************** /*****************************************************************************
* misc.m: code not specific to vlc * misc.m: code not specific to vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2003-2007 the VideoLAN team * Copyright (C) 2003-2008 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Felix Paul Khne <fkuehne at videolan dot org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -21,12 +22,13 @@ ...@@ -21,12 +22,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#include <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <QuickTime/QuickTime.h>
#include "intf.h" /* VLCApplication */ #import "intf.h" /* VLCApplication */
#include "misc.h" #import "misc.h"
#include "playlist.h" #import "playlist.h"
#include "controls.h" #import "controls.h"
/***************************************************************************** /*****************************************************************************
* NSAnimation (VLCAdditions) * NSAnimation (VLCAdditions)
...@@ -113,7 +115,6 @@ static NSMutableArray *blackoutWindows = NULL; ...@@ -113,7 +115,6 @@ static NSMutableArray *blackoutWindows = NULL;
[blackoutWindows makeObjectsPerformSelector:@selector(close)]; [blackoutWindows makeObjectsPerformSelector:@selector(close)];
[blackoutWindows removeAllObjects]; [blackoutWindows removeAllObjects];
for(i = 0; i < [[NSScreen screens] count]; i++) for(i = 0; i < [[NSScreen screens] count]; i++)
{ {
NSScreen *screen = [[NSScreen screens] objectAtIndex: i]; NSScreen *screen = [[NSScreen screens] objectAtIndex: i];
...@@ -124,7 +125,7 @@ static NSMutableArray *blackoutWindows = NULL; ...@@ -124,7 +125,7 @@ static NSMutableArray *blackoutWindows = NULL;
continue; continue;
screen_rect = [screen frame]; screen_rect = [screen frame];
screen_rect.origin.x = screen_rect.origin.y = 0.0f; screen_rect.origin.x = screen_rect.origin.y = 0;
/* blackoutWindow alloc strategy /* blackoutWindow alloc strategy
- The NSMutableArray blackoutWindows has the blackoutWindow references - The NSMutableArray blackoutWindows has the blackoutWindow references
...@@ -135,10 +136,14 @@ static NSMutableArray *blackoutWindows = NULL; ...@@ -135,10 +136,14 @@ static NSMutableArray *blackoutWindows = NULL;
[blackoutWindow setBackgroundColor:[NSColor blackColor]]; [blackoutWindow setBackgroundColor:[NSColor blackColor]];
[blackoutWindow setLevel: NSFloatingWindowLevel]; /* Disappear when Expose is triggered */ [blackoutWindow setLevel: NSFloatingWindowLevel]; /* Disappear when Expose is triggered */
[blackoutWindow displayIfNeeded];
[blackoutWindow orderFront: self animate: YES]; [blackoutWindow orderFront: self animate: YES];
[blackoutWindows addObject: blackoutWindow]; [blackoutWindows addObject: blackoutWindow];
[blackoutWindow release]; [blackoutWindow release];
if( [screen isMainScreen ] )
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
} }
} }
...@@ -151,6 +156,8 @@ static NSMutableArray *blackoutWindows = NULL; ...@@ -151,6 +156,8 @@ static NSMutableArray *blackoutWindows = NULL;
VLCWindow *blackoutWindow = [blackoutWindows objectAtIndex: i]; VLCWindow *blackoutWindow = [blackoutWindows objectAtIndex: i];
[blackoutWindow closeAndAnimate: YES]; [blackoutWindow closeAndAnimate: YES];
} }
SetSystemUIMode( kUIModeNormal, 0);
} }
@end @end
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Derk-Jan Hartman <hartman at videolan dot org> * Derk-Jan Hartman <hartman at videolan dot org>
* Eric Petit <titer@m0k.org> * Eric Petit <titer@m0k.org>
* Benjamin Pracht <bigben at videolan dot org> * Benjamin Pracht <bigben at videolan dot org>
* Felix Kühne <fkuehne at videolan dot org> * Felix Paul Kühne <fkuehne at videolan dot org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
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