From 226cc03845cb8b381866da5f4f7fa33aba151697 Mon Sep 17 00:00:00 2001 From: Rodrigo Dias Date: Mon, 1 Apr 2024 21:57:58 +0100 Subject: [PATCH] Fix MacOS menu bar & dock stop appearing after closing sub-window When the progress dialog task for saving a scene ends, or when closing the "Open project" dialog, the DisplayServerMacOS::update_presentation_mode() method now restores those fullscreen functionalities with the flags NSApplicationPresentationAutoHideMenuBar and NSApplicationPresentationAutoHideDock, whereas before it would reset to NSApplicationPresentationDefault, which didn't allow that. Fixes #86495 --- platform/macos/display_server_macos.mm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm index 9d6531a2b505..b7a9fb1bbd76 100644 --- a/platform/macos/display_server_macos.mm +++ b/platform/macos/display_server_macos.mm @@ -2084,12 +2084,21 @@ } void DisplayServerMacOS::update_presentation_mode() { + bool has_fs_windows = false; for (const KeyValue &wd : windows) { - if (wd.value.fullscreen && wd.value.exclusive_fullscreen) { - return; + if (wd.value.fullscreen) { + if (wd.value.exclusive_fullscreen) { + return; + } else { + has_fs_windows = true; + } } } - [NSApp setPresentationOptions:NSApplicationPresentationDefault]; + if (has_fs_windows) { + [NSApp setPresentationOptions:NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationAutoHideDock | NSApplicationPresentationFullScreen]; + } else { + [NSApp setPresentationOptions:NSApplicationPresentationDefault]; + } } void DisplayServerMacOS::window_set_min_size(const Size2i p_size, WindowID p_window) {