[macOS] Disable Dock and Menu in fullscreen mode.

This commit is contained in:
bruvzg 2022-11-04 16:33:18 +02:00
parent 28afd32d29
commit dbb52395bc
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38

View file

@ -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;