From f444da80bcafc7ded1395a0c5349e991fef2fcfd Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Mon, 17 Oct 2016 13:43:44 -0700 Subject: [PATCH] Add a 2 second delay before the About window shows up on the first run --- ZeroTier One/AppDelegate.m | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ZeroTier One/AppDelegate.m b/ZeroTier One/AppDelegate.m index 86c83367c..b1d8cce25 100644 --- a/ZeroTier One/AppDelegate.m +++ b/ZeroTier One/AppDelegate.m @@ -84,9 +84,12 @@ [prefsView setLaunchAtLoginEnabled:YES]; - [[NSOperationQueue mainQueue] addOperationWithBlock:^{ - [self showAbout]; - }]; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + sleep(2); + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ + [self showAbout]; + }]; + }); } [self.monitor updateNetworkInfo]; @@ -316,7 +319,11 @@ } - (void)closeJoinNetworkPopover { - + if (self.transientMonitor) { + [NSEvent removeMonitor:self.transientMonitor]; + self.transientMonitor = nil; + } + [self.joinNetworkPopover close]; } @end