--(void) applicationDidFinishLaunching: (NSNotification*) notification {
- [jsController setup];
- [drawer open];
- [targetController setEnabled: false];
- [self setActive: NO];
- [configsController load];
- EventTypeSpec et;
- et.eventClass = kEventClassApplication;
- et.eventKind = kEventAppFrontSwitched;
- EventHandlerUPP handler = NewEventHandlerUPP(appSwitch);
- InstallApplicationEventHandler(handler, 1, &et, self, NULL);
+- (void)didSwitchApplication:(NSNotification *)notification {
+ NSRunningApplication *currentApp = notification.userInfo[NSWorkspaceApplicationKey];
+ [self.configsController activateConfigForProcess:currentApp.localizedName];