Disable automatic termination when simulation is active. This is probably a good...
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Wed, 14 Aug 2013 19:26:18 +0000 (21:26 +0200)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Wed, 14 Aug 2013 19:26:18 +0000 (21:26 +0200)
Classes/EnjoyableApplicationDelegate.m

index 76f99e041bc28eba558258578fa99306783b00f2..449f6ef4bab5808164322c42635a91099ea13034 100644 (file)
 - (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