From 6e8be3b03ea9ed68f4d76f42256c9745e7088d02 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 3 Jan 2021 22:04:54 +0100 Subject: Fix #8067: [OSX] Calculate title bar height instead of assuming a fixed value. --- src/video/cocoa/cocoa_v.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/video') 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; -- cgit v1.2.3-70-g09d2