I've just managed to make my app work correctly again using the following code. It uses deprecated functions (as of 10.9) so I don't expect those functions to disappear soon. Not ideal, but at least it does not result in a weird user experience.
(OSStatus)makeApplicationFront:(NSRunningApplication*)application
{
if(!application || application.processIdentifier == -1) {
return procNotFound; // Previous front most application is nil or does not have a process identifier.
}
ProcessSerialNumber process;
OSStatus error = GetProcessForPID(application.processIdentifier, &process); // Deprecated, but replacement (NSRunningApplication:activateWithOptions:] does not work properly on Big Sur.
if(error) {
return error; // Process could not be obtained. Evaluate error (e.g. using osstatus.com) to understand why.
}
return SetFrontProcessWithOptions(&process, kSetFrontProcessFrontWindowOnly); // Deprecated, but replacement (NSRunningApplication:activateWithOptions:] does not work properly on Big Sur.
}
Hope it also helps you.