Commit afafeb19 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

Compare two NSScreen using their display id, rather than their pointer values. (pointed by thedj)

parent 2f8dbe1e
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
+ (NSScreen *)screenWithDisplayID: (CGDirectDisplayID)displayID; + (NSScreen *)screenWithDisplayID: (CGDirectDisplayID)displayID;
- (BOOL)isMainScreen; - (BOOL)isMainScreen;
- (BOOL)isScreen: (NSScreen*)screen;
- (CGDirectDisplayID)displayID; - (CGDirectDisplayID)displayID;
- (void)blackoutOtherScreens; - (void)blackoutOtherScreens;
+ (void)unblackoutScreens; + (void)unblackoutScreens;
......
...@@ -95,6 +95,11 @@ static NSMutableArray *blackoutWindows = NULL; ...@@ -95,6 +95,11 @@ static NSMutableArray *blackoutWindows = NULL;
return ([self displayID] == [[[NSScreen screens] objectAtIndex:0] displayID]); return ([self displayID] == [[[NSScreen screens] objectAtIndex:0] displayID]);
} }
- (BOOL)isScreen: (NSScreen*)screen
{
return ([self displayID] == [screen displayID]);
}
- (CGDirectDisplayID)displayID - (CGDirectDisplayID)displayID
{ {
return (CGDirectDisplayID)_screenNumber; return (CGDirectDisplayID)_screenNumber;
...@@ -113,7 +118,7 @@ static NSMutableArray *blackoutWindows = NULL; ...@@ -113,7 +118,7 @@ static NSMutableArray *blackoutWindows = NULL;
{ {
VLCWindow *blackoutWindow; VLCWindow *blackoutWindow;
NSScreen *screen = [[NSScreen screens] objectAtIndex: i]; NSScreen *screen = [[NSScreen screens] objectAtIndex: i];
if(self == screen) if([self isScreen: screen])
continue; continue;
/* blackoutWindow alloc strategy /* blackoutWindow alloc strategy
- The NSMutableArray blackoutWindows has the blackoutWindow references - The NSMutableArray blackoutWindows has the blackoutWindow references
......
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