Activate app if update check is initiated from NSStatusItem (#2950)

This commit is contained in:
Niklas Wenzel authored and GitHub committed 2026-11-11 20:23:59 -08:00
1 parent 95533f1811
commit 4b20aee135
1 file changed
+4 -3
+4 -3
View File
@@ -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];
}