Commit 144e4cc2 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

Fix main screen detection on Mac OS X.

parent 164bd431
...@@ -193,7 +193,7 @@ ...@@ -193,7 +193,7 @@
CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token); CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token);
CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES ); CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
if (screen == [NSScreen mainScreen]) if ([screen isMainScreen])
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar); SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
[[self contentView] replaceSubview:o_view with:o_temp_view]; [[self contentView] replaceSubview:o_view with:o_temp_view];
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
[o_fullscreen_anim2 release]; [o_fullscreen_anim2 release];
} }
if (screen == [NSScreen mainScreen]) if ([screen isMainScreen])
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar); SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
dict1 = [[NSMutableDictionary alloc] initWithCapacity:2]; dict1 = [[NSMutableDictionary alloc] initWithCapacity:2];
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
@interface NSScreen (VLCAdditions) @interface NSScreen (VLCAdditions)
+ (NSScreen *)screenWithDisplayID: (CGDirectDisplayID)displayID; + (NSScreen *)screenWithDisplayID: (CGDirectDisplayID)displayID;
- (BOOL)isMainScreen;
- (CGDirectDisplayID)displayID; - (CGDirectDisplayID)displayID;
- (void)blackoutOtherScreens; - (void)blackoutOtherScreens;
+ (void)unblackoutScreens; + (void)unblackoutScreens;
......
...@@ -90,6 +90,11 @@ static NSMutableArray *blackoutWindows = NULL; ...@@ -90,6 +90,11 @@ static NSMutableArray *blackoutWindows = NULL;
return nil; return nil;
} }
- (BOOL)isMainScreen
{
return ([self displayID] == [[[NSScreen screens] objectAtIndex:0] displayID]);
}
- (CGDirectDisplayID)displayID - (CGDirectDisplayID)displayID
{ {
return (CGDirectDisplayID)_screenNumber; return (CGDirectDisplayID)_screenNumber;
......
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