diff --git a/platforms/iOS/vm/OSX/sqSqueakOSXOpenGLView.m b/platforms/iOS/vm/OSX/sqSqueakOSXOpenGLView.m index a50adb3e96..65474ad5b8 100644 --- a/platforms/iOS/vm/OSX/sqSqueakOSXOpenGLView.m +++ b/platforms/iOS/vm/OSX/sqSqueakOSXOpenGLView.m @@ -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]; } }