Skip to content

Commit

Permalink
Fixing Bug #274872: "Activate host app on automatic update when when …
Browse files Browse the repository at this point in the history
…host runs in background"
  • Loading branch information
andymatuschak committed Aug 27, 2009
1 parent d62e47c commit bd99d04
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions SUAutomaticUpdateDriver.m
Expand Up @@ -16,6 +16,16 @@ @implementation SUAutomaticUpdateDriver
- (void)unarchiverDidFinish:(SUUnarchiver *)ua - (void)unarchiverDidFinish:(SUUnarchiver *)ua
{ {
alert = [[SUAutomaticUpdateAlert alloc] initWithAppcastItem:updateItem host:host delegate:self]; alert = [[SUAutomaticUpdateAlert alloc] initWithAppcastItem:updateItem host:host delegate:self];

// If the app is a menubar app or the like, we need to focus it first and alter the
// update prompt to behave like a normal window. Otherwise if the window were hidden
// there may be no way for the application to be activated to make it visible again.
if ([host isBackgroundApplication])
{
[[alert window] setHidesOnDeactivate:NO];
[NSApp activateIgnoringOtherApps:YES];
}

if ([NSApp isActive]) if ([NSApp isActive])
[[alert window] makeKeyAndOrderFront:self]; [[alert window] makeKeyAndOrderFront:self];
else else
Expand Down

0 comments on commit bd99d04

Please sign in to comment.