[macOS] Refocus last key window after `DisplayServer::alert` is closed.

(cherry picked from commit a05776e20d)
This commit is contained in:
bruvzg 2020-07-26 23:00:30 +03:00 committed by Rémi Verschelde
parent cd01cda143
commit a2f034d3ab
1 changed files with 4 additions and 0 deletions

View File

@ -1873,8 +1873,12 @@ void OS_OSX::alert(const String &p_alert, const String &p_title) {
[window setAlertStyle:NSAlertStyleWarning]; [window setAlertStyle:NSAlertStyleWarning];
// Display it, then release // Display it, then release
id key_window = [[NSApplication sharedApplication] keyWindow];
[window runModal]; [window runModal];
[window release]; [window release];
if (key_window) {
[key_window makeKeyAndOrderFront:nil];
}
} }
Error OS_OSX::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) { Error OS_OSX::open_dynamic_library(const String p_path, void *&p_library_handle, bool p_also_set_library_path) {