summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2020-07-26 23:00:30 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2020-07-26 23:00:49 +0300
commita05776e20da8220ea7af364bbffbd43cd4605981 (patch)
tree0b921370ccd22e98e2a3b5701a04632adc915a6b
parentd7e00a20a62f40f853c2137f024eb4dc05267b9d (diff)
[macOS] Refocus last key window after `DisplayServer::alert` is closed.
-rw-r--r--platform/osx/display_server_osx.mm4
1 files changed, 4 insertions, 0 deletions
diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm
index a6e117ab1d..4c04151791 100644
--- a/platform/osx/display_server_osx.mm
+++ b/platform/osx/display_server_osx.mm
@@ -1944,8 +1944,12 @@ void DisplayServerOSX::alert(const String &p_alert, const String &p_title) {
[window setInformativeText:ns_alert];
[window setAlertStyle:NSAlertStyleWarning];
+ id key_window = [[NSApplication sharedApplication] keyWindow];
[window runModal];
[window release];
+ if (key_window) {
+ [key_window makeKeyAndOrderFront:nil];
+ }
}
Error DisplayServerOSX::dialog_show(String p_title, String p_description, Vector<String> p_buttons, const Callable &p_callback) {