From c9d4a4ebb54a6325f8da29b2b137f6425ad3eb8d Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sun, 3 Jul 2016 21:32:58 +0300 Subject: [PATCH] Proper fullscreen support (Including Yosemite and older) --- Cocoa/Document.m | 16 +++++++++++++++- Cocoa/Document.xib | 1 + Cocoa/Preferences.xib | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Cocoa/Document.m b/Cocoa/Document.m index 1dbefaf..24482c3 100644 --- a/Cocoa/Document.m +++ b/Cocoa/Document.m @@ -11,7 +11,8 @@ reasonable alternative to this. */ unsigned long pendingLogLines; bool tooMuchLogs; - + bool fullScreen; + NSString *lastConsoleInput; } @@ -262,8 +263,21 @@ static uint32_t rgbEncode(GB_gameboy_t *gb, uint8_t r, uint8_t g, uint8_t b) } +- (void) windowWillEnterFullScreen:(NSNotification *)notification +{ + fullScreen = true; +} + +- (void) windowWillExitFullScreen:(NSNotification *)notification +{ + fullScreen = false; +} + - (NSRect)windowWillUseStandardFrame:(NSWindow *)window defaultFrame:(NSRect)newFrame { + if (fullScreen) { + return newFrame; + } NSRect rect = window.contentView.frame; int titlebarSize = window.contentView.superview.frame.size.height - rect.size.height; diff --git a/Cocoa/Document.xib b/Cocoa/Document.xib index 754e92f..472f71f 100644 --- a/Cocoa/Document.xib +++ b/Cocoa/Document.xib @@ -18,6 +18,7 @@ + diff --git a/Cocoa/Preferences.xib b/Cocoa/Preferences.xib index af4b38e..43b27b4 100644 --- a/Cocoa/Preferences.xib +++ b/Cocoa/Preferences.xib @@ -13,6 +13,7 @@ +