From 15fcaffc91d9e7f96905ea85bfe5c19e0109862c Mon Sep 17 00:00:00 2001 From: MichaelJBerk <49624366+MichaelJBerk@users.noreply.github.com> Date: Fri, 12 Jan 2024 06:01:57 -0500 Subject: [PATCH] Activate OpenRCT2 window after using native file dialog on macOS (#20951) --- src/openrct2-ui/UiContext.macOS.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/openrct2-ui/UiContext.macOS.mm b/src/openrct2-ui/UiContext.macOS.mm index f7e7577b41..4e4b6b2744 100644 --- a/src/openrct2-ui/UiContext.macOS.mm +++ b/src/openrct2-ui/UiContext.macOS.mm @@ -129,6 +129,7 @@ namespace OpenRCT2::Ui } else { + SDL_RaiseWindow(window); return std::string(); } @@ -137,10 +138,12 @@ namespace OpenRCT2::Ui panel.directoryURL = [NSURL fileURLWithPath:directory]; if ([panel runModal] == NSModalResponseCancel) { + SDL_RaiseWindow(window); return std::string(); } else { + SDL_RaiseWindow(window); return panel.URL.path.UTF8String; } } @@ -158,10 +161,12 @@ namespace OpenRCT2::Ui { NSString* selectedPath = panel.URL.path; const char* path = selectedPath.UTF8String; + SDL_RaiseWindow(window); return path; } else { + SDL_RaiseWindow(window); return ""; } }