- (void)eventSimulationStarted:(NSNotification *)note {
self.simulatingEventsButton.state = NSOnState;
statusItem.image = [NSImage imageNamed:@"Status Menu Icon"];
+ [NSProcessInfo.processInfo
+ disableAutomaticTermination:@"Event simulation running."];
[NSWorkspace.sharedWorkspace.notificationCenter
addObserver:self
selector:@selector(didSwitchApplication:)
- (void)eventSimulationStopped:(NSNotification *)note {
self.simulatingEventsButton.state = NSOffState;
statusItem.image = [NSImage imageNamed:@"Status Menu Icon Disabled"];
+ [NSProcessInfo.processInfo
+ enableAutomaticTermination:@"Event simulation running."];
[NSWorkspace.sharedWorkspace.notificationCenter
removeObserver:self
name:NSWorkspaceDidActivateApplicationNotification