diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2020-07-26 23:00:30 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2020-07-26 23:00:49 +0300 |
commit | a05776e20da8220ea7af364bbffbd43cd4605981 (patch) | |
tree | 0b921370ccd22e98e2a3b5701a04632adc915a6b | |
parent | d7e00a20a62f40f853c2137f024eb4dc05267b9d (diff) |
[macOS] Refocus last key window after `DisplayServer::alert` is closed.
-rw-r--r-- | platform/osx/display_server_osx.mm | 4 |
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) { |