diff --git a/lib/mac/mac_util.mm b/lib/mac/mac_util.mm index 4978150ed5..aa36898ec7 100644 --- a/lib/mac/mac_util.mm +++ b/lib/mac/mac_util.mm @@ -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); + } }