From afafeb19b897427835244a34607b7327cddff45d Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont Date: Sat, 3 Mar 2007 01:05:53 +0000 Subject: [PATCH] Compare two NSScreen using their display id, rather than their pointer values. (pointed by thedj) --- modules/gui/macosx/misc.h | 1 + modules/gui/macosx/misc.m | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/gui/macosx/misc.h b/modules/gui/macosx/misc.h index 6a636d81c2..a2dfefd7c0 100644 --- a/modules/gui/macosx/misc.h +++ b/modules/gui/macosx/misc.h @@ -42,6 +42,7 @@ + (NSScreen *)screenWithDisplayID: (CGDirectDisplayID)displayID; - (BOOL)isMainScreen; +- (BOOL)isScreen: (NSScreen*)screen; - (CGDirectDisplayID)displayID; - (void)blackoutOtherScreens; + (void)unblackoutScreens; diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m index b61c60107a..9f313272bb 100644 --- a/modules/gui/macosx/misc.m +++ b/modules/gui/macosx/misc.m @@ -95,6 +95,11 @@ static NSMutableArray *blackoutWindows = NULL; return ([self displayID] == [[[NSScreen screens] objectAtIndex:0] displayID]); } +- (BOOL)isScreen: (NSScreen*)screen +{ + return ([self displayID] == [screen displayID]); +} + - (CGDirectDisplayID)displayID { return (CGDirectDisplayID)_screenNumber; @@ -113,7 +118,7 @@ static NSMutableArray *blackoutWindows = NULL; { VLCWindow *blackoutWindow; NSScreen *screen = [[NSScreen screens] objectAtIndex: i]; - if(self == screen) + if([self isScreen: screen]) continue; /* blackoutWindow alloc strategy - The NSMutableArray blackoutWindows has the blackoutWindow references -- 2.39.2