diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-01-03 22:04:54 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-01-03 22:24:04 +0100 |
commit | 6e8be3b03ea9ed68f4d76f42256c9745e7088d02 (patch) | |
tree | 3e10aaeae500bf04fc82bead795aede0693e1120 /src/video | |
parent | 0f91cb04791b329c5e457588a39d1e7a43e43136 (diff) | |
download | openttd-6e8be3b03ea9ed68f4d76f42256c9745e7088d02.tar.xz |
Fix #8067: [OSX] Calculate title bar height instead of assuming a fixed value.
Diffstat (limited to 'src/video')
-rw-r--r-- | src/video/cocoa/cocoa_v.mm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm index c7c5a308e..81715ff92 100644 --- a/src/video/cocoa/cocoa_v.mm +++ b/src/video/cocoa/cocoa_v.mm @@ -569,7 +569,8 @@ bool WindowQuartzSubdriver::SetVideoMode(int width, int height, int bpp) [ this->window setContentSize:contentRect.size ]; /* Ensure frame height - title bar height >= view height */ - contentRect.size.height = Clamp(height, 0, (int)[ this->window frame ].size.height - 22 /* 22 is the height of title bar of window*/); + float content_height = [ this->window contentRectForFrameRect:[ this->window frame ] ].size.height; + contentRect.size.height = Clamp(height, 0, (int)content_height); if (this->cocoaview != nil) { height = (int)contentRect.size.height; |