Skip to content

Commit

Permalink
Make fullscreen mode consistent across Metal and OpenGL
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Mar 2, 2020
1 parent 1861db5 commit 0818124
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 28 deletions.
19 changes: 6 additions & 13 deletions platforms/iOS/vm/OSX/sqSqueakOSXMetalView.m
Expand Up @@ -48,7 +48,6 @@

extern SqueakOSXAppDelegate *gDelegateApp;
extern struct VirtualMachine* interpreterProxy;
extern sqInt getFullScreenFlag();

static sqSqueakOSXMetalView *mainMetalView;

Expand Down Expand Up @@ -231,7 +230,8 @@ - (void) drawThelayers {

if (!firstDrawCompleted) {
firstDrawCompleted = YES;
if (!getFullScreenFlag()) {
extern sqInt getFullScreenFlag(void);
if (getFullScreenFlag() == 0) {
[self.window makeKeyAndOrderFront: self];
}
}
Expand Down Expand Up @@ -875,17 +875,10 @@ - (BOOL)ignoreModifierKeysWhileDragging {

#pragma mark Fullscreen

- (void) ioSetFullScreen: (sqInt) fullScreen {
if (getFullScreenFlag() == fullScreen)
return; // not changing fullscreen mode

self.fullScreenInProgress = YES;
[self.window toggleFullScreen:self];

if (getFullScreenFlag() && !fullScreen) {
if ([self.window isKeyWindow] == NO) {
[self.window makeKeyAndOrderFront: self];
}
- (void) ioSetFullScreen: (sqInt) fullScreen {
if ((self.window.styleMask & NSFullScreenWindowMask) != (fullScreen == 1)) {
self.fullScreenInProgress = YES;
[self.window toggleFullScreen: nil];
}
}

Expand Down
18 changes: 3 additions & 15 deletions platforms/iOS/vm/OSX/sqSqueakOSXOpenGLView.m
Expand Up @@ -1114,23 +1114,11 @@ - (void) clearScreen {
}
}

- (void) ioSetFullScreen: (sqInt) fullScreen {

if ((self.window.styleMask & NSFullScreenWindowMask) && (fullScreen == 1))
return;
if (!(self.window.styleMask & NSFullScreenWindowMask) && (fullScreen == 0))
return;

if (!(self.window.styleMask & NSFullScreenWindowMask) && (fullScreen == 1)) {
self.fullScreenInProgress = YES;

- (void) ioSetFullScreen: (sqInt) fullScreen {
if ((self.window.styleMask & NSFullScreenWindowMask) != (fullScreen == 1)) {
self.fullScreenInProgress = YES;
[self.window toggleFullScreen: nil];
}

if ((self.window.styleMask & NSFullScreenWindowMask) && (fullScreen == 0)) {
self.fullScreenInProgress = YES;
[self.window toggleFullScreen: nil];
}
}

- (void) preDrawThelayers {
Expand Down

0 comments on commit 0818124

Please sign in to comment.