Permalink
Browse files

Fixing Bug #274872: "Activate host app on automatic update when when …

…host runs in background"
  • Loading branch information...
1 parent d62e47c commit bd99d0451d3881457b89217b7c5dc599c218533a @andymatuschak andymatuschak committed Aug 27, 2009
Showing with 10 additions and 0 deletions.
  1. +10 −0 SUAutomaticUpdateDriver.m
View
@@ -16,6 +16,16 @@ @implementation SUAutomaticUpdateDriver
- (void)unarchiverDidFinish:(SUUnarchiver *)ua
{
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])
[[alert window] makeKeyAndOrderFront:self];
else

0 comments on commit bd99d04

Please sign in to comment.