From 2023380cbff58c2ece9005f3b3ed728649a5a730 Mon Sep 17 00:00:00 2001 From: Lawrence Kesteloot Date: Mon, 27 Aug 2018 10:05:54 -0700 Subject: [PATCH] Fix size of window on MacOS. The API for NSWindow's creation has a contentRect parameter, but it seems to be handled like a frameRect. So convert from contentRect to frameRect first. Without this change the top 20-ish lines of the image are under the title bar. --- src/macosx/MacMiniFB.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/macosx/MacMiniFB.m b/src/macosx/MacMiniFB.m index 076d2bc..f7b892c 100644 --- a/src/macosx/MacMiniFB.m +++ b/src/macosx/MacMiniFB.m @@ -26,7 +26,8 @@ int mfb_open(const char* name, int width, int height) NSWindowStyleMask styles = NSWindowStyleMaskResizable | NSWindowStyleMaskClosable | NSWindowStyleMaskTitled; NSRect rectangle = NSMakeRect(0, 0, width, height); - window_ = [[OSXWindow alloc] initWithContentRect:rectangle styleMask:styles backing:NSBackingStoreBuffered defer:NO]; + NSRect frameRect = [NSWindow frameRectForContentRect:rectangle styleMask:styles]; + window_ = [[OSXWindow alloc] initWithContentRect:frameRect styleMask:styles backing:NSBackingStoreBuffered defer:NO]; if (!window_) return 0;