From 16e72665d082500d32542921be0dfb87509bcecf Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 27 Dec 2018 20:09:48 -0800 Subject: Fixed issue with transitioning to full screen in Vulkan mode on Mac --- .../Apple/Source/Classes/OSX/WindowController.m | 34 +++++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'Common/NativeApp') diff --git a/Common/NativeApp/Apple/Source/Classes/OSX/WindowController.m b/Common/NativeApp/Apple/Source/Classes/OSX/WindowController.m index 3a37fc6..794ec4e 100644 --- a/Common/NativeApp/Apple/Source/Classes/OSX/WindowController.m +++ b/Common/NativeApp/Apple/Source/Classes/OSX/WindowController.m @@ -42,11 +42,21 @@ //...don't do anything return; } + + GLView* glView = nil; + if ([self.window.contentView isKindOfClass: [GLView class]]) + { + glView = (GLView *)self.window.contentView; + } + // We must stop the display link while // switching the windows to make sure // that render commands are not issued // from another thread - [self.window.contentView stopDisplayLink]; + if (glView != nil) + { + [glView stopDisplayLink]; + } // Allocate a new fullscreen window [self setFullscreenWindow: [[FullscreenWindow alloc] init]]; @@ -76,7 +86,10 @@ [[self fullscreenWindow] makeKeyAndOrderFront:self]; // Restore display link - [self.window.contentView startDisplayLink]; + if (glView != nil) + { + [glView startDisplayLink]; + } } - (void) goWindow @@ -87,11 +100,21 @@ //...app is already windowed so don't do anything return; } + + GLView* glView = nil; + if ([self.window.contentView isKindOfClass: [GLView class]]) + { + glView = (GLView *)self.window.contentView; + } + // We must stop the display link while // switching the windows to make sure // that render commands are not issued // from another thread - [self.window.contentView stopDisplayLink]; + if (glView) + { + [glView stopDisplayLink]; + } // Get the rectangle of the original window NSRect viewRect = [[self standardWindow] frame]; @@ -117,7 +140,10 @@ [self setFullscreenWindow: nil]; // Restore display link - [self.window.contentView startDisplayLink]; + if (glView) + { + [glView startDisplayLink]; + } } -- cgit v1.2.3