diff --git a/Cocoa/AppDelegate.m b/Cocoa/AppDelegate.m index e54012f..133fab7 100644 --- a/Cocoa/AppDelegate.m +++ b/Cocoa/AppDelegate.m @@ -51,7 +51,9 @@ JOYHatsEmulateButtonsKey: @YES, }]; - [NSUserNotificationCenter defaultUserNotificationCenter].delegate = self; + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"GBNotificationsUsed"]) { + [NSUserNotificationCenter defaultUserNotificationCenter].delegate = self; + } } - (IBAction)toggleDeveloperMode:(id)sender diff --git a/Cocoa/Document.m b/Cocoa/Document.m index ece8092..c7c1e35 100644 --- a/Cocoa/Document.m +++ b/Cocoa/Document.m @@ -404,6 +404,7 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp) unsigned time_to_alarm = GB_time_to_alarm(&gb); if (time_to_alarm) { + [NSUserNotificationCenter defaultUserNotificationCenter].delegate = (id)[NSApp delegate]; NSUserNotification *notification = [[NSUserNotification alloc] init]; NSString *friendlyName = [[self.fileName lastPathComponent] stringByDeletingPathExtension]; NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"\\([^)]+\\)|\\[[^\\]]+\\]" options:0 error:nil];