From 1a09bae4372b02d06411922f0e396b49ceaf31f2 Mon Sep 17 00:00:00 2001 From: Pablo Tesone Date: Thu, 21 Mar 2019 17:21:35 +0100 Subject: [PATCH] Fixing the change to fullscreen --- platforms/iOS/vm/OSX/sqSqueakOSXOpenGLView.m | 23 +++++++------------- 1 file changed, 8 insertions(+), 15 deletions(-) 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]; } }