macOS: switch method to bring child processes to front

Fixes https://gitlab.com/kicad/code/kicad/-/issues/14060
This commit is contained in:
Jon Evans 2023-10-24 17:27:20 -04:00
parent 0158377cb7
commit 617a975b32
1 changed files with 5 additions and 1 deletions

View File

@ -870,9 +870,13 @@ int KICAD_MANAGER_CONTROL::Execute( const TOOL_EVENT& aEvent )
if( pid > 0 )
{
#ifdef __WXMAC__
wxString script = wxString::Format( wxS( "tell application \"System Events\"\n"
" set frontmost of the first process whose unix id is %l to true\n"
"end tell" ), pid );
// This non-parameterized use of wxExecute is fine because execFile is not derived
// from user input.
wxExecute( "osascript -e 'activate application \"" + execFile + "\"'" );
wxExecute( wxString::Format( "osascript -e '%s'", script ) );
#endif
}
else