diff options
author | Davide Beatrici <davidebeatrici@gmail.com> | 2019-10-09 07:07:43 +0300 |
---|---|---|
committer | Davide Beatrici <davidebeatrici@gmail.com> | 2019-10-10 00:35:47 +0300 |
commit | 796eabaf17091e1540ad08068b07965221003550 (patch) | |
tree | 9fc9a81fa77eac3190f4b0a0d1bb8c2c1599e3bd | |
parent | 9ab5fe97b62b374e7985df72fc3087facec753b8 (diff) |
GlobalShortcuts_macx.mm: replace deprecated GetProcessForPID() and CopyProcessName()
Both deprecated in macOS 10.9.
https://developer.apple.com/documentation/applicationservices/1501069-getprocessforpid
https://developer.apple.com/documentation/applicationservices/1501067-copyprocessname
-rw-r--r-- | src/mumble/GlobalShortcut_macx.mm | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/mumble/GlobalShortcut_macx.mm b/src/mumble/GlobalShortcut_macx.mm index 6d5367dac..a44dc7728 100644 --- a/src/mumble/GlobalShortcut_macx.mm +++ b/src/mumble/GlobalShortcut_macx.mm @@ -203,14 +203,10 @@ void GlobalShortcutMac::dumpEventTaps() { for (uint32_t i = 0; i < ntaps; i++) { CGEventTapInformation *info = &table[i]; - ProcessSerialNumber psn; NSString *processName = nil; - OSStatus err = GetProcessForPID(info->tappingProcess, &psn); - if (err == noErr) { - CFStringRef str = NULL; - CopyProcessName(&psn, &str); - processName = (NSString *) str; - [processName autorelease]; + NSRunningApplication *app = [NSRunningApplication runningApplicationWithProcessIdentifier: info->processBeingTapped]; + if (app) { + processName = [app localizedName]; } qWarning("{"); |