28#if OO_MAC_SUPPORT_SYSTEM_STANDARD_FULL_SCREEN
37#ifndef NSAppKitVersionNumber10_7
38#define NSAppKitVersionNumber10_7 1138
42@implementation OOMacSystemStandardFullScreenController
44+ (BOOL) shouldUseSystemStandardFullScreenController
46 if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_6)
53 NSString *
override = [[NSUserDefaults standardUserDefaults] stringForKey:@"full-screen-mode-override"];
56 if ([
override isEqualToString:
@"lion"])
return YES;
57 if ([
override isEqualToString:
@"snow-leopard"])
return NO;
60 if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_7)
66 return NSScreen.screens.count == 1;
70- (BOOL) inFullScreenMode
72 return ([NSApp presentationOptions] & NSApplicationPresentationFullScreen) != 0;
76- (void) setFullScreenMode:(BOOL)value
78 if (value !=
self.fullScreenMode)
81 NSAssert([window isKindOfClass:
OOPrimaryWindow.class],
@"Incorrect UI setup; main game window should be OOPrimaryWindow.");
83 [window makeKeyAndOrderFront:nil];
84 [window standardToggleFullScreen:nil];
89- (NSArray *) displayModes
91 NSSize
size =
self.gameView.window.frame.size;
92 NSDictionary *fakeMode = [NSDictionary dictionaryWithObjectsAndKeys:
93 [NSNumber numberWithUnsignedInt:size.width], kOODisplayWidth,
94 [NSNumber numberWithUnsignedInt:size.height], kOODisplayHeight,
96 return [NSArray arrayWithObject:fakeMode];
100- (NSUInteger) indexOfCurrentDisplayMode
106- (BOOL) setDisplayWidth:(NSUInteger)width height:(NSUInteger)height refreshRate:(NSUInteger)refresh
112- (NSDictionary *) findDisplayModeForWidth:(NSUInteger)width height:(NSUInteger)height refreshRate:(NSUInteger)refresh
114 NSDictionary *fakeMode = [
self.displayModes objectAtIndex:0];
126 [
self.gameView noteMouseInteractionModeChangedFrom:oldMode to:newMode];