Skip to content

Commit a4f2e52

Browse files
committed
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 godotengine#86495
1 parent 29b3d9e commit a4f2e52

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

platform/macos/display_server_macos.mm

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,12 +2084,21 @@
20842084
}
20852085

20862086
void DisplayServerMacOS::update_presentation_mode() {
2087+
bool has_fs_windows = false;
20872088
for (const KeyValue<WindowID, WindowData> &wd : windows) {
2088-
if (wd.value.fullscreen && wd.value.exclusive_fullscreen) {
2089-
return;
2089+
if (wd.value.fullscreen) {
2090+
if (wd.value.exclusive_fullscreen) {
2091+
return;
2092+
} else {
2093+
has_fs_windows = true;
2094+
}
20902095
}
20912096
}
2092-
[NSApp setPresentationOptions:NSApplicationPresentationDefault];
2097+
if (has_fs_windows) {
2098+
[NSApp setPresentationOptions:NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationAutoHideDock | NSApplicationPresentationFullScreen];
2099+
} else {
2100+
[NSApp setPresentationOptions:NSApplicationPresentationDefault];
2101+
}
20932102
}
20942103

20952104
void DisplayServerMacOS::window_set_min_size(const Size2i p_size, WindowID p_window) {

0 commit comments

Comments
 (0)