Possible to get a handle for the automatic update alertbox window ?

Asked by Dave Carpeneto

Hi - I'm using Sparkle for a fullscreen app that fills the display @ CGShieldingWindowLevel, which means that the SUAutomaticUpdateAlert is never seen (it's hidden, as far as I can tell from the source the alert window is brought up to NSFloatingWindowLevel , which is beneath CGShieldingWindowLevel).

Question is this: is there a simple way for me to get a programatic handle on the automatic update alertbox window ? If I did then I could set the window level via some delegate method.

Alternately: Is there another way to do what I'm attempting here ?

I'd reely reely like to avoid recompiling sparkle if possible - any insight appreciated :-)

Question information

Language:
English Edit question
Status:
Solved
For:
Sparkle Edit question
Assignee:
No assignee Edit question
Solved by:
Andy Matuschak
Solved:
Last query:
Last reply:
Revision history for this message
Best Andy Matuschak (andymatuschak) said :
#1

Sorry, but this is not a public component; you'll have to build your own branch!

Revision history for this message
Dave Carpeneto (carpeneto) said :
#2

Thanks Andy Matuschak, that solved my question.

Revision history for this message
Dave Carpeneto (carpeneto) said :
#3

OK, just posing this here in case someone else is in the same situation as I (FWIW I didn't want to branch Sparkle - it's fairly stable now, but you never know where this will go).

Here's what I did (this works for me because all my window titles are empty, and the perf hit seems negligible): in my app's delegate I put the following:

every time the the app is going to update it's windows:
    get a list of windows
    for each window:
        if the tile is empty (& therefore the update window):
            promote to CGShieldingWindowLevel
            if not key:
                close (since my main window is transparent, and it looks goofy floating behind the main window).

... it's not ideal, but it works:

- (void)applicationWillUpdate:(NSNotification *)notification {
  NSArray *windowList = [NSApp windows];
  for (NSWindow *thisWindow in windowList) {
    if ([[thisWindow title] isEqualToString:@""] == NO ) {
      [thisWindow setLevel:CGShieldingWindowLevel()];
      if ([thisWindow isKeyWindow] == NO) {
        [thisWindow performClose:self];
      }
    }
  }
}

... again, thanks for your quick response in the first place, and for creating the framework to begin with - it's fabulous :-)