2323#include " native_menu_model.h"
2424#include " appshell_node_process.h"
2525
26+ #include " AppKit/NSApplication.h"
27+
2628#include " TrafficLightsView.h"
2729#include " TrafficLightsViewController.h"
2830#include " client_colors_mac.h"
3234
3335#import " CustomTitlebarView.h"
3436
37+ // If app is built with 10.9 or lower
38+ // this constant is not defined.
39+ #ifndef NSAppKitVersionNumber10_10
40+ #define NSAppKitVersionNumber10_10 1343
41+ #endif
42+
3543// Application startup time
3644CFTimeInterval g_appStartupTime;
3745
@@ -253,17 +261,23 @@ -(void)windowTitleDidChange:(NSString*)title {
253261#endif
254262}
255263
256- -(BOOL )isRunningOnYosemite {
257- NSDictionary * dict = [NSDictionary dictionaryWithContentsOfFile: @" /System/Library/CoreServices/SystemVersion.plist" ];
258- NSString * version = [dict objectForKey: @" ProductVersion" ];
259- return [version hasPrefix: @" 10.10" ];
264+ -(BOOL )isRunningOnYosemiteOrLater {
265+ // This seems to be a more reliable way of checking
266+ // the MACOS version. Documentation about this available
267+ // at the following link.
268+ // https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/cross_development/Using/using.html
269+
270+ if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_10 )
271+ return true ;
272+ else
273+ return false ;
260274}
261275
262276- (BOOL )isFullScreenSupported {
263277 // Return False on Yosemite so we
264278 // don't draw our own full screen button
265279 // and handle full screen mode
266- if (![self isRunningOnYosemite ]) {
280+ if (![self isRunningOnYosemiteOrLater ]) {
267281 SInt32 version;
268282 Gestalt (gestaltSystemVersion, &version);
269283 return (version >= 0x1070 );
@@ -272,7 +286,7 @@ - (BOOL)isFullScreenSupported {
272286}
273287
274288-(BOOL )needsFullScreenActivateHack {
275- if (![self isRunningOnYosemite ]) {
289+ if (![self isRunningOnYosemiteOrLater ]) {
276290 SInt32 version;
277291 Gestalt (gestaltSystemVersion, &version);
278292 return (version >= 0x1090 );
@@ -281,7 +295,7 @@ -(BOOL)needsFullScreenActivateHack {
281295}
282296
283297-(BOOL )useSystemTrafficLights {
284- return [self isRunningOnYosemite ];
298+ return [self isRunningOnYosemiteOrLater ];
285299}
286300
287301-(void )windowDidResize : (NSNotification *)notification
0 commit comments