From a2f034d3ab78df26090e2240ed9f3fdbf2ff975f 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. (cherry picked from commit a05776e20da8220ea7af364bbffbd43cd4605981) --- platform/osx/os_osx.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 49c4f755d38..bfa7194a1a2 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1873,8 +1873,12 @@ void OS_OSX::alert(const String &p_alert, const String &p_title) { [window setAlertStyle:NSAlertStyleWarning]; // Display it, then release + id key_window = [[NSApplication sharedApplication] keyWindow]; [window runModal]; [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) {