From dbb52395bc7a795c0e05b1c4613aeaa239fb3999 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Fri, 4 Nov 2022 16:33:18 +0200 Subject: [PATCH] [macOS] Disable Dock and Menu in fullscreen mode. --- platform/osx/os_osx.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index e203a341a76..cc9b9287ed2 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -329,6 +329,8 @@ static NSCursor *cursorFromSelector(SEL selector, SEL fallback = nil) { if (OS_OSX::singleton->on_top) [OS_OSX::singleton->window_object setLevel:NSFloatingWindowLevel]; + [NSApp setPresentationOptions:NSApplicationPresentationDefault]; + // Force window resize event. [self windowDidResize:notification]; } @@ -2884,6 +2886,12 @@ void OS_OSX::set_window_fullscreen(bool p_enabled) { [window_object setContentMaxSize:NSMakeSize(size.x, size.y)]; } } + if (p_enabled) { + const NSUInteger presentationOptions = NSApplicationPresentationHideDock | NSApplicationPresentationHideMenuBar; + [NSApp setPresentationOptions:presentationOptions]; + } else { + [NSApp setPresentationOptions:NSApplicationPresentationDefault]; + } [window_object toggleFullScreen:nil]; } zoomed = p_enabled;