Activate OpenRCT2 window after using native file dialog on macOS (#20951)

This commit is contained in:
MichaelJBerk 2024-01-12 06:01:57 -05:00 committed by GitHub
parent 0e5c82e2d4
commit 15fcaffc91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -129,6 +129,7 @@ namespace OpenRCT2::Ui
} }
else else
{ {
SDL_RaiseWindow(window);
return std::string(); return std::string();
} }
@ -137,10 +138,12 @@ namespace OpenRCT2::Ui
panel.directoryURL = [NSURL fileURLWithPath:directory]; panel.directoryURL = [NSURL fileURLWithPath:directory];
if ([panel runModal] == NSModalResponseCancel) if ([panel runModal] == NSModalResponseCancel)
{ {
SDL_RaiseWindow(window);
return std::string(); return std::string();
} }
else else
{ {
SDL_RaiseWindow(window);
return panel.URL.path.UTF8String; return panel.URL.path.UTF8String;
} }
} }
@ -158,10 +161,12 @@ namespace OpenRCT2::Ui
{ {
NSString* selectedPath = panel.URL.path; NSString* selectedPath = panel.URL.path;
const char* path = selectedPath.UTF8String; const char* path = selectedPath.UTF8String;
SDL_RaiseWindow(window);
return path; return path;
} }
else else
{ {
SDL_RaiseWindow(window);
return ""; return "";
} }
} }