summaryrefslogtreecommitdiff
path: root/platform/osx/os_osx.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/osx/os_osx.mm')
-rw-r--r--platform/osx/os_osx.mm10
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index dc87f767f6..b084a08ecc 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -1497,6 +1497,16 @@ Size2 OS_OSX::get_window_size() const {
void OS_OSX::set_window_size(const Size2 p_size) {
Size2 size=p_size;
+
+ // NSRect used by setFrame includes the title bar, so add it to our size.y
+ CGFloat menuBarHeight = [[[NSApplication sharedApplication] mainMenu] menuBarHeight];
+ if (menuBarHeight != 0.f) {
+ size.y+= menuBarHeight;
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101104
+ } else {
+ size.y+= [[NSStatusBar systemStatusBar] thickness];
+#endif
+ }
NSRect frame = [window_object frame];
[window_object setFrame:NSMakeRect(frame.origin.x, frame.origin.y, size.x, size.y) display:YES];
};