From 565119e9b963202d9ce94adc87b06102c50e0188 Mon Sep 17 00:00:00 2001 From: Andrey Tarantsov Date: Thu, 24 Oct 2013 13:36:25 +0700 Subject: [PATCH] Try to disable App Nap via beginActivityWithOptions:reason: --- LiveReload/Classes/Application/LiveReloadAppDelegate.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/LiveReload/Classes/Application/LiveReloadAppDelegate.m b/LiveReload/Classes/Application/LiveReloadAppDelegate.m index 9f0fd7ed7..b2b47164e 100644 --- a/LiveReload/Classes/Application/LiveReloadAppDelegate.m +++ b/LiveReload/Classes/Application/LiveReloadAppDelegate.m @@ -105,6 +105,10 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { // I can imagine there any many more cases when it comes in handy. putenv("INVOKED_FROM_LIVERELOAD=1"); + if ([[NSProcessInfo processInfo] respondsToSelector:@selector(beginActivityWithOptions:reason:)]) { + [[NSProcessInfo processInfo] beginActivityWithOptions:NSActivityAutomaticTerminationDisabled|NSActivityBackground reason:@"Background file monitoring"]; + } + // fish does not work well with our rvm shenanigans const char *shell = getenv("SHELL"); if (shell) {