From 24e41be33daa2af38d6bf6fde31c400ca3ac73c9 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] 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 f746f8de8..8c4f493dc 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -327,6 +327,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]; } @@ -2831,6 +2833,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;