|
48 | 48 |
|
49 | 49 | extern SqueakOSXAppDelegate *gDelegateApp; |
50 | 50 | extern struct VirtualMachine* interpreterProxy; |
| 51 | +extern int getFullScreenFlag(); |
51 | 52 |
|
52 | 53 | static sqSqueakOSXMetalView *mainMetalView; |
53 | 54 |
|
@@ -230,7 +231,6 @@ - (void) drawThelayers { |
230 | 231 |
|
231 | 232 | if (!firstDrawCompleted) { |
232 | 233 | firstDrawCompleted = YES; |
233 | | - extern sqInt getFullScreenFlag(void); |
234 | 234 | if (getFullScreenFlag() == 0) { |
235 | 235 | [self.window makeKeyAndOrderFront: self]; |
236 | 236 | } |
@@ -876,25 +876,13 @@ - (BOOL)ignoreModifierKeysWhileDragging { |
876 | 876 | #pragma mark Fullscreen |
877 | 877 |
|
878 | 878 | - (void) ioSetFullScreen: (sqInt) fullScreen { |
| 879 | + if (getFullScreenFlag() == (fullScreen == 1)) |
| 880 | + return; // not changing fullscreen mode |
879 | 881 |
|
880 | | - if ([self isInFullScreenMode] == YES && (fullScreen == 1)) |
881 | | - return; |
882 | | - if ([self isInFullScreenMode] == NO && (fullScreen == 0)) |
883 | | - return; |
884 | | - |
885 | | - if ([self isInFullScreenMode] == NO && (fullScreen == 1)) { |
886 | | - self.fullScreenInProgress = YES; |
887 | | - NSDictionary* options = [NSDictionary dictionaryWithObjectsAndKeys: |
888 | | - [NSNumber numberWithInt: |
889 | | - NSApplicationPresentationHideDock | |
890 | | - NSApplicationPresentationHideMenuBar ], |
891 | | - NSFullScreenModeApplicationPresentationOptions, nil]; |
892 | | - [self enterFullScreenMode:[NSScreen mainScreen] withOptions:options]; |
893 | | - } |
| 882 | + self.fullScreenInProgress = YES; |
| 883 | + [self.window toggleFullScreen:self]; |
894 | 884 |
|
895 | | - if ([self isInFullScreenMode] == YES && (fullScreen == 0)) { |
896 | | - self.fullScreenInProgress = YES; |
897 | | - [self exitFullScreenModeWithOptions: NULL]; |
| 885 | + if (getFullScreenFlag() && (fullScreen == 0)) { |
898 | 886 | if ([self.window isKeyWindow] == NO) { |
899 | 887 | [self.window makeKeyAndOrderFront: self]; |
900 | 888 | } |
|
0 commit comments