mirror of https://github.com/BOINC/boinc.git
Mac uninstaller: fix incompatibility with OS 10.6
This commit is contained in:
parent
a909b421e4
commit
ff355b7a6c
|
@ -50,9 +50,14 @@ void BringAppWithPidToFront(pid_t pid) {
|
|||
|
||||
|
||||
void getFrontMostApp(char * appName, size_t maxLen) {
|
||||
NSRunningApplication * frontApp = [[NSWorkspace sharedWorkspace] frontmostApplication];
|
||||
NSString * name = [frontApp localizedName];
|
||||
strlcpy(appName, [name UTF8String], maxLen);
|
||||
if ([[NSWorkspace sharedWorkspace] respondsToSelector: @selector(frontmostApplication)]){
|
||||
NSRunningApplication * frontApp = [[NSWorkspace sharedWorkspace] frontmostApplication];
|
||||
NSString * name = [frontApp localizedName];
|
||||
strlcpy(appName, [name UTF8String], maxLen);
|
||||
} else {
|
||||
// NSWorkspace frontmostApplication is not available in OS 10.6
|
||||
strlcpy(appName, "UserNotificationCenter", maxLen);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue