From 4b20aee135d5a29ce418fc6fc8d211945c2edeeb Mon Sep 17 00:00:00 2001 From: Niklas Wenzel Date: Thu, 12 Nov 2026 05:23:59 +0100 Subject: [PATCH] Activate app if update check is initiated from NSStatusItem (#2950) --- Sparkle/SPUStandardUserDriver.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Sparkle/SPUStandardUserDriver.m b/Sparkle/SPUStandardUserDriver.m index c3743ee4..f8b63e56 100644 --- a/Sparkle/SPUStandardUserDriver.m +++ b/Sparkle/SPUStandardUserDriver.m @@ -548,9 +548,10 @@ static const NSTimeInterval SUShowCheckingForUpdatesTimeDelay = 0.3; [_checkingController beginActionWithTitle:SULocalizedStringFromTableInBundle(@"Checking for updates…", SPARKLE_TABLE, sparkleBundle, nil) maxProgressValue:0.0 statusText:nil]; [_checkingController setButtonTitle:SULocalizedStringFromTableInBundle(@"Cancel", SPARKLE_TABLE, sparkleBundle, nil) target:self action:@selector(cancelCheckForUpdates:) isDefault:NO accessibilityIdentifier:@"SUStatusCancel"]; - // For background applications, obtain focus. - // Useful if the update check is requested from another app like System Preferences. - if ([SUApplicationInfo isBackgroundApplication:[NSApplication sharedApplication]]) { + // Obtain focus. Useful if: + // - The update check is requested from another app (e.g. System Preferences) + // - The user triggers the update check from an NSStatusItem (which does not activate the app) + if (![NSApp isActive]) { [self _activateApplication]; }