summaryrefslogtreecommitdiff
path: root/src/video/cocoa
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-01-03 22:04:54 +0100
committerMichael Lutz <michi@icosahedron.de>2021-01-03 22:24:04 +0100
commit6e8be3b03ea9ed68f4d76f42256c9745e7088d02 (patch)
tree3e10aaeae500bf04fc82bead795aede0693e1120 /src/video/cocoa
parent0f91cb04791b329c5e457588a39d1e7a43e43136 (diff)
downloadopenttd-6e8be3b03ea9ed68f4d76f42256c9745e7088d02.tar.xz
Fix #8067: [OSX] Calculate title bar height instead of assuming a fixed value.
Diffstat (limited to 'src/video/cocoa')
-rw-r--r--src/video/cocoa/cocoa_v.mm3
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;