Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong window size on MacOS #14

Closed
lkesteloot opened this issue Aug 27, 2018 · 1 comment
Closed

Wrong window size on MacOS #14

lkesteloot opened this issue Aug 27, 2018 · 1 comment

Comments

@lkesteloot
Copy link
Contributor

On MacOS the window is not tall enough, because the passed-in rectangle (the size of the image) is used for the entire window, including the title bar. I don't know why, since the API for NSWindow calls the parameter contentRect. You have to convert from contentRect to frameRect yourself in mfb_open():

        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];
@emoon
Copy link
Owner

emoon commented Aug 27, 2018

Thanks! Can you create a PR with this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants