diff -r e55a17cdabd2 -r 3d3dcc3116d5 UniqueWindowController.m --- a/UniqueWindowController.m Thu Mar 20 09:05:58 2008 -0700 +++ b/UniqueWindowController.m Wed Apr 02 14:45:33 2008 -0700 @@ -7,6 +7,7 @@ // #import "UniqueWindowController.h" +#import "GraphicsUtils.h" @implementation UniqueWindowController @@ -14,13 +15,10 @@ + (UniqueWindowController*) instanceWith: (id)model { - for( NSWindow *window in [NSApp windows] ) { - id delegate = window.delegate; - if( window.isVisible && [delegate isKindOfClass: [self class]] ) { - UniqueWindowController *c = delegate; - if( c.model == model ) - return c; - } + for( NSWindow *window in OpenWindowsWithDelegateClass(self) ) { + UniqueWindowController *c = window.delegate; + if( c.model == model ) + return c; } return nil; }