Skip to content

Commit

Permalink
Fixing the change to fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
tesonep committed Mar 21, 2019
1 parent fd460b8 commit 1a09bae
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 1a09bae

Please sign in to comment.