Skip to content

Commit

Permalink
Fix MacOS menu bar & dock stop appearing after closing sub-window
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rodrigodias4 committed Apr 1, 2024
1 parent 29b3d9e commit a4f2e52
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions platform/macos/display_server_macos.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2084,12 +2084,21 @@
}

void DisplayServerMacOS::update_presentation_mode() {
bool has_fs_windows = false;
for (const KeyValue<WindowID, WindowData> &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) {
Expand Down

0 comments on commit a4f2e52

Please sign in to comment.