Compare two NSScreen using their display id, rather than their pointer values. (point...
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 3 Mar 2007 01:05:53 +0000 (01:05 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 3 Mar 2007 01:05:53 +0000 (01:05 +0000)
modules/gui/macosx/misc.h
modules/gui/macosx/misc.m

index 6a636d8..a2dfefd 100644 (file)
@@ -42,6 +42,7 @@
 
 + (NSScreen *)screenWithDisplayID: (CGDirectDisplayID)displayID;
 - (BOOL)isMainScreen;
+- (BOOL)isScreen: (NSScreen*)screen;
 - (CGDirectDisplayID)displayID;
 - (void)blackoutOtherScreens;
 + (void)unblackoutScreens;
index b61c601..9f31327 100644 (file)
@@ -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