From a05776e20da8220ea7af364bbffbd43cd4605981 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Sun, 26 Jul 2020 23:00:30 +0300 Subject: [PATCH] [macOS] Refocus last key window after `DisplayServer::alert` is closed. --- platform/osx/display_server_osx.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm index a6e117ab1d5..4c041517910 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 p_buttons, const Callable &p_callback) {