]> git.sesse.net Git - vlc/commitdiff
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 7510e787671dfbf5631eb1b561bd7180ff0d9a4b..02c848814f1d321522f0810f58a7589e9183a56f 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 9cb548e1096956813ef1bc9a10a4676baa95d2e1..6a636d81c21d30ff66241e4a8946d17bd07cefab 100644 (file)
@@ -41,6 +41,7 @@
 @interface NSScreen (VLCAdditions)
 
 + (NSScreen *)screenWithDisplayID: (CGDirectDisplayID)displayID;
+- (BOOL)isMainScreen;
 - (CGDirectDisplayID)displayID;
 - (void)blackoutOtherScreens;
 + (void)unblackoutScreens;
index b60ec2e564d0457f1b971050b394c2431c6d95ec..b61c60107a2d9a463cd453b395fb8863d22fe368 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;