+ // If the screen saver is not running, then launch the updater now.
+ // Otherwise, wait until the screen saver deactivates, and then do
+ // it. This is because if the updater tries to pop up a dialog box
+ // while the screen saver is active, everything goes to hell and it
+ // never shows up. You'd expect the dialog to just map below the
+ // screen saver window, but no.
+
+ if (! [self screenSaverActive]) {
+ [self runUpdater];
+ } else {
+ // Run the updater when the "screensaver.didstop" notification arrives.
+ [[NSDistributedNotificationCenter defaultCenter]
+ addObserver:self
+ selector:@selector(saverStoppedNotification:)
+ name:@"com.apple.screensaver.didstop"
+ object:nil];
+
+ // But I'm not sure I trust that, so also poll every couple minutes.
+ timer = [NSTimer scheduledTimerWithTimeInterval: 60 * 2
+ target:self
+ selector:@selector(pollSaverTermination:)
+ userInfo:nil
+ repeats:YES];
+ }