NSWindow's -orderOut: unreliable with Spaces?
NSWindow's -orderOut: unreliable with Spaces?
- Subject: NSWindow's -orderOut: unreliable with Spaces?
- From: Keith Blount <email@hidden>
- Date: Thu, 17 Dec 2009 16:42:41 -0800 (PST)
Hello,
I'm not sure if this is intended behaviour or a bug, but does anyone know why NSWindow's -orderOut: is unreliable when used with Spaces?
I have a loading panel that appears when large projects are opened, and I was closing this panel using -orderOut:. However, it turns out that using -orderOut:, the panel will never close in the following circumstance:
- If the user has the application assigned to a Space.
- If the user is working in a different Space, so that opening the application causes the current Space to change.
- If the project is set to open on application start-up.
You can see this for yourself by setting up a with a panel and placing the following code in e.g. the NSDocument subclass's -windowControllerDidLoadNib:
- (void)windowControllerDidLoadNib:(NSWindowController *) aController
{
[super windowControllerDidLoadNib:aController];
// Add any code here that needs to be executed once the windowController has loaded the document's window.
[panel makeKeyAndOrderFront:nil];
[NSThread sleepUntilDate:[[NSDate date] addTimeInterval:1]];
[panel orderOut:nil];
}
Then assign the app to a different Space.
Actually, on further testing, this may be a Leopard-only thing. I can't reproduce this in Snow Leopard, but I can't find anything in the Snow Leopard release notes about this being behaviour that has been fixed. Could it be something to do with the collection behaviour that I am missing?
At any rates, changing it to [panel close] instead of [panel orderOut:nil] resolves the issue, but I was under the impression that -orderOut: was the more common method to use for hiding windows you didn't want to release - now I have to go through and ensure my panels are set not to be released when closed to work around this.
If anyone knows the reason behind this behaviour, I'd be very grateful to hear it.
Thanks and all the best,
Keith
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden