Fixing Bug #274872: "Activate host app on automatic update when when host runs in background"

This commit is contained in:
Andy Matuschak committed 2009-08-27 00:04:53 -07:00
1 parent d62e47cd2e
commit bd99d0451d
1 file changed
+10
+10
View File
@@ -16,6 +16,16 @@
- (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