X-Git-Url: https://git.yukkurigames.com/?a=blobdiff_plain;f=ApplicationController.m;h=09be1c04d6811747fc928e7ab18fb42fd2e43ba6;hb=d9d15b3f8729758f19b21918fee758b856921673;hp=e87421c062b0e173d01965140ca5bf2a21b8e5d1;hpb=3a40cba25b9bb38887fe4809277d4c0f73462d12;p=enjoyable.git 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