X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=ApplicationController.m;h=09be1c04d6811747fc928e7ab18fb42fd2e43ba6;hp=e87421c062b0e173d01965140ca5bf2a21b8e5d1;hb=19eadf9e688d8c087b47f83f8634593fddd641ac;hpb=3dfe18e6224331f1161ddcc057f755d41ff55266 diff --git a/ApplicationController.m b/ApplicationController.m index e87421c..09be1c0 100644 --- a/ApplicationController.m +++ b/ApplicationController.m @@ -15,14 +15,7 @@ - (void)didSwitchApplication:(NSNotification *)notification { NSRunningApplication *currentApp = notification.userInfo[NSWorkspaceApplicationKey]; - ProcessSerialNumber psn; - OSStatus err; - if ((err = GetProcessForPID(currentApp.processIdentifier, &psn)) == noErr) { - [self.configsController applicationSwitchedTo:currentApp.localizedName withPsn:psn]; - } else { - NSError *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:err userInfo:nil]; - NSLog(@"Error getting PSN for %@: %@", currentApp.localizedName, error); - } + [self.configsController activateConfigForProcess:currentApp.localizedName]; } - (void)applicationDidFinishLaunching:(NSNotification *)notification { @@ -94,6 +87,6 @@ - (void)chooseConfig:(id)sender { int idx = [dockMenuBase indexOfItem:sender] - [self firstConfigMenuIndex]; Config *chosen = self.configsController.configs[idx]; - [configsController activateConfig:chosen forApplication:NULL]; + [configsController activateConfig:chosen]; } @end