diff --git a/Cocoa/Document.h b/Cocoa/Document.h index 869abe6a..6a47aa7f 100644 --- a/Cocoa/Document.h +++ b/Cocoa/Document.h @@ -6,6 +6,7 @@ @property (strong) IBOutlet NSTextView *consoleOutput; @property (strong) IBOutlet NSPanel *consoleWindow; @property (strong) IBOutlet NSTextField *consoleInput; +@property (strong) IBOutlet NSWindow *mainWindow; @end diff --git a/Cocoa/Document.m b/Cocoa/Document.m index df5b007f..ea4f7652 100644 --- a/Cocoa/Document.m +++ b/Cocoa/Document.m @@ -173,6 +173,12 @@ static uint32_t rgbEncode(GB_gameboy_t *gb, unsigned char r, unsigned char g, un self.consoleOutput.textContainerInset = NSMakeSize(4, 4); [self.view becomeFirstResponder]; self.view.shouldBlendFrameWithPrevious = ![[NSUserDefaults standardUserDefaults] boolForKey:@"DisableFrameBlending"]; + CGRect window_frame = self.mainWindow.frame; + window_frame.size.width = MAX([[NSUserDefaults standardUserDefaults] integerForKey:@"LastWindowWidth"], + window_frame.size.width); + window_frame.size.height = MAX([[NSUserDefaults standardUserDefaults] integerForKey:@"LastWindowHeight"], + window_frame.size.height); + [self.mainWindow setFrame:window_frame display:YES]; [self start]; } @@ -199,6 +205,8 @@ static uint32_t rgbEncode(GB_gameboy_t *gb, unsigned char r, unsigned char g, un - (void)close { + [[NSUserDefaults standardUserDefaults] setInteger:self.mainWindow.frame.size.width forKey:@"LastWindowWidth"]; + [[NSUserDefaults standardUserDefaults] setInteger:self.mainWindow.frame.size.height forKey:@"LastWindowHeight"]; [self stop]; [self.consoleWindow close]; [super close]; diff --git a/Cocoa/Document.xib b/Cocoa/Document.xib index d2cd3f95..b3066894 100644 --- a/Cocoa/Document.xib +++ b/Cocoa/Document.xib @@ -9,6 +9,7 @@ +