Fix main screen detection on Mac OS X.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 3 Mar 2007 00:29:56 +0000 (00:29 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 3 Mar 2007 00:29:56 +0000 (00:29 +0000)
modules/gui/macosx/embeddedwindow.m
modules/gui/macosx/misc.h
modules/gui/macosx/misc.m

index 7510e78..02c8488 100644 (file)
             CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token);
             CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
             
-            if (screen == [NSScreen mainScreen])
+            if ([screen isMainScreen])
                 SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
             
             [[self contentView] replaceSubview:o_view with:o_temp_view];
         [o_fullscreen_anim2 release];
     }
  
-    if (screen == [NSScreen mainScreen])
+    if ([screen isMainScreen])
         SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
 
     dict1 = [[NSMutableDictionary alloc] initWithCapacity:2];
index 9cb548e..6a636d8 100644 (file)
@@ -41,6 +41,7 @@
 @interface NSScreen (VLCAdditions)
 
 + (NSScreen *)screenWithDisplayID: (CGDirectDisplayID)displayID;
+- (BOOL)isMainScreen;
 - (CGDirectDisplayID)displayID;
 - (void)blackoutOtherScreens;
 + (void)unblackoutScreens;
index b60ec2e..b61c601 100644 (file)
@@ -90,6 +90,11 @@ static NSMutableArray *blackoutWindows = NULL;
     return nil;
 }
 
+- (BOOL)isMainScreen
+{
+    return ([self displayID] == [[[NSScreen screens] objectAtIndex:0] displayID]);
+}
+
 - (CGDirectDisplayID)displayID
 {
     return (CGDirectDisplayID)_screenNumber;