From 112a174f4ab047e45080a34da9530b41f9ad7165 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 5 Jan 2019 23:58:18 +0200 Subject: [PATCH] Proper window minimum size handling --- Cocoa/Document.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Cocoa/Document.m b/Cocoa/Document.m index cd2e969..c94f77b 100644 --- a/Cocoa/Document.m +++ b/Cocoa/Document.m @@ -286,7 +286,13 @@ static void printImage(GB_gameboy_t *gb, uint32_t *image, uint8_t height, if (old_width != GB_get_screen_width(&gb)) { [self.view screenSizeChanged]; } - + + self.mainWindow.contentMinSize = NSMakeSize(GB_get_screen_width(&gb), GB_get_screen_height(&gb)); + if (self.mainWindow.contentView.bounds.size.width < GB_get_screen_width(&gb) || + self.mainWindow.contentView.bounds.size.width < GB_get_screen_height(&gb)) { + [self.mainWindow zoom:nil]; + } + if ([sender tag] != 0) { /* User explictly selected a model, save the preference */ [[NSUserDefaults standardUserDefaults] setBool:current_model == MODEL_DMG forKey:@"EmulateDMG"];