Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
isolate hacks to >= 10.9
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffryBooher committed Nov 12, 2013
1 parent dd08f7a commit 59ac8f0
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 13 deletions.
33 changes: 24 additions & 9 deletions appshell/cefclient_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ - (BOOL)isFullScreenSupported {
return (version >= 0x1070);
}

-(BOOL)needsFullScreenActivateHack {
SInt32 version;
Gestalt(gestaltSystemVersion, &version);

This comment has been minimized.

Copy link
@bobeast

bobeast Nov 13, 2013

Gestalt is deprecated as of 10.8. see the discussion in https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKit/ regarding runtime version checking. Also should probably factor runtime version checking into its own method to avoid code duplication.

return (version >= 0x1090);
}

-(void)windowDidResize:(NSNotification *)notification
{

Expand All @@ -241,20 +247,29 @@ -(void)windowDidResize:(NSNotification *)notification
#endif
}


- (void)windowWillEnterFullScreen:(NSNotification *)notification {
[NSApp activateIgnoringOtherApps:YES];
[NSApp unhide:nil];
NSWindow* window = [notification object];
NSView* contentView = [window contentView];
#ifdef DARK_UI
if ([self needsFullScreenActivateHack]) {
[NSApp activateIgnoringOtherApps:YES];
[NSApp unhide:nil];
NSWindow* window = [notification object];
NSView* contentView = [window contentView];

[contentView setNeedsDisplay:YES];
[contentView setNeedsDisplay:YES];
}
#endif
}

- (void)windowDidEnterFullScreen:(NSNotification *)notification {
NSWindow* window = [notification object];
NSView* contentView = [window contentView];

[contentView setNeedsDisplay:YES];
#ifdef DARK_UI
if ([self needsFullScreenActivateHack]) {
NSWindow* window = [notification object];
NSView* contentView = [window contentView];

[contentView setNeedsDisplay:YES];
}
#endif
}


Expand Down
23 changes: 19 additions & 4 deletions appshell/client_handler_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ - (BOOL)isFullScreenSupported {
return (version >= 0x1070);
}


-(BOOL)needsFullScreenActivateHack {
SInt32 version;
Gestalt(gestaltSystemVersion, &version);
return (version >= 0x1090);
}

- (void)setFullScreenButtonView:(NSView *)view {
fullScreenButtonView = view;
}
Expand Down Expand Up @@ -296,14 +303,22 @@ - (void)windowDidExitFullScreen:(NSNotification *)notification {


- (void)windowWillEnterFullScreen:(NSNotification *)notification {
[NSApp activateIgnoringOtherApps:YES];
[NSApp unhide:nil];
#ifdef DARK_UI
if ([self needsFullScreenActivateHack]) {
[NSApp activateIgnoringOtherApps:YES];
[NSApp unhide:nil];
}
#endif
}


- (void)windowDidEnterFullScreen:(NSNotification *)notification {
NSView* contentView = [window contentView];
[contentView setNeedsDisplay:YES];
#ifdef DARK_UI
if ([self needsFullScreenActivateHack]) {
NSView* contentView = [window contentView];
[contentView setNeedsDisplay:YES];
}
#endif
}

// Called when the window is about to close. Perform the self-destruction
Expand Down

0 comments on commit 59ac8f0

Please sign in to comment.