From 39f17764e3ac7a336cbc0fec520f22c69eec66a6 Mon Sep 17 00:00:00 2001 From: Zorg Date: Thu, 24 Sep 2015 20:43:20 -0400 Subject: [PATCH] Don't show Autoupdate dock icon if we shouldn't show UI --- Sparkle/Autoupdate/Autoupdate.m | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Sparkle/Autoupdate/Autoupdate.m b/Sparkle/Autoupdate/Autoupdate.m index 0c7db37c..cfbc3f5d 100644 --- a/Sparkle/Autoupdate/Autoupdate.m +++ b/Sparkle/Autoupdate/Autoupdate.m @@ -130,11 +130,13 @@ static const NSTimeInterval SUInstallationTimeLimit = 5; [self.terminationListener startListeningWithCompletion:^{ self.terminationListener = nil; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(SUInstallationTimeLimit * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - // Show app icon in the dock - ProcessSerialNumber psn = { 0, kCurrentProcess }; - TransformProcessType(&psn, kProcessTransformToForegroundApplication); - }); + if (self.shouldShowUI) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(SUInstallationTimeLimit * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + // Show app icon in the dock + ProcessSerialNumber psn = { 0, kCurrentProcess }; + TransformProcessType(&psn, kProcessTransformToForegroundApplication); + }); + } [self install]; }];