From a71b2b2f6551644bdecac9a7c0449334ac410425 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Thu, 28 Jun 2018 05:04:15 -0700 Subject: [PATCH] Fix media key hook for Mojave. --- Application/MediaKeysApplication.m | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Application/MediaKeysApplication.m b/Application/MediaKeysApplication.m index 1dc3fafb6..303146c89 100644 --- a/Application/MediaKeysApplication.m +++ b/Application/MediaKeysApplication.m @@ -35,16 +35,12 @@ if([SPMediaKeyTap usesGlobalMediaKeyTap]) { if (![keyTap startWatchingMediaKeys]) { NSAlert *alert = [[NSAlert alloc] init]; - [alert addButtonWithTitle:@"Retry"]; - [alert addButtonWithTitle:@"Cancel"]; + [alert addButtonWithTitle:@"OK"]; [alert setMessageText:@"Enable Media Key access?"]; - [alert setInformativeText:@"Media Key support requires the \"Accessibility\" permission."]; + [alert setInformativeText:@"Media Key support requires the \"Accessibility\" permission. You will need to restart the application for the change to take effect."]; [alert setAlertStyle:NSInformationalAlertStyle]; - if ([alert runModal] == NSAlertFirstButtonReturn) { - NSString *path = [[NSBundle mainBundle] executablePath]; - NSString *processID = [NSString stringWithFormat:@"%d",[[NSProcessInfo processInfo] processIdentifier]]; - [NSTask launchedTaskWithLaunchPath:path arguments:[NSArray arrayWithObjects:path,processID,nil]]; - } + [alert runModal]; + ALog(@"Media key monitoring disabled until application is restarted"); } } else