Skip to content

Commit

Permalink
Merge pull request #381 from tesonep/Cog
Browse files Browse the repository at this point in the history
Fixing the change to fullscreen
  • Loading branch information
eliotmiranda authored Mar 23, 2019
2 parents 2c700e0 + 1a09bae commit 8d0fe14
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions platforms/iOS/vm/OSX/sqSqueakOSXOpenGLView.m
Original file line number Diff line number Diff line change
Expand Up @@ -1114,27 +1114,20 @@ - (void) clearScreen {

- (void) ioSetFullScreen: (sqInt) fullScreen {

if ([self isInFullScreenMode] == YES && (fullScreen == 1))
if ((self.window.styleMask & NSFullScreenWindowMask) && (fullScreen == 1))
return;
if ([self isInFullScreenMode] == NO && (fullScreen == 0))
if (!(self.window.styleMask & NSFullScreenWindowMask) && (fullScreen == 0))
return;

if ([self isInFullScreenMode] == NO && (fullScreen == 1)) {
self.fullScreenInProgress = YES;
NSDictionary* options = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:
NSApplicationPresentationHideDock |
NSApplicationPresentationHideMenuBar ],
NSFullScreenModeApplicationPresentationOptions, nil];
[self enterFullScreenMode:[NSScreen mainScreen] withOptions:options];
if (!(self.window.styleMask & NSFullScreenWindowMask) && (fullScreen == 1)) {
self.fullScreenInProgress = YES;

[self.window toggleFullScreen: nil];
}

if ([self isInFullScreenMode] == YES && (fullScreen == 0)) {
if ((self.window.styleMask & NSFullScreenWindowMask) && (fullScreen == 0)) {
self.fullScreenInProgress = YES;
[self exitFullScreenModeWithOptions: NULL];
if ([self.window isKeyWindow] == NO) {
[self.window makeKeyAndOrderFront: self];
}
[self.window toggleFullScreen: nil];
}
}

Expand Down

0 comments on commit 8d0fe14

Please sign in to comment.