orderOut: doesn't work as expected when executed in Spaces-mode
orderOut: doesn't work as expected when executed in Spaces-mode
- Subject: orderOut: doesn't work as expected when executed in Spaces-mode
- From: Mattias Arrelid <email@hidden>
- Date: Wed, 12 Dec 2007 16:08:41 +0100
Hi everyone,
I've got an application that has several windows. Sometimes they're
ordered out programmatically. To my surprise, this "fails" when the
user has activated Spaces. To reproduce, follow these very simple steps:
1. Create a test application ("Cocoa Application") using XCode.
2. Create a controller class and instansiate it in Interface Builder
3. Make the controller the application's delegate (ctrl-dragging in IB
works just fine).
4. In the controller's @implementation, add this code:
- (void)tryClose:(NSTimer *)timer {
NSLog(@"Before sleep");
[NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:10]];
[[NSApp mainWindow] orderOut:self];
NSLog(@"After sleep");
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
NSTimer *aTimer = [NSTimer scheduledTimerWithTimeInterval:5
target:self
selector:@selector(tryClose:)
userInfo:nil
repeats:FALSE];
}
5. Launch the application (with a console available)
6. When it say's "Before sleep", active Spaces (and keep it activated!)
7. Note how the window disappears after 10 seconds (accompanied by a
info text in the console)
8. Left-click in the Space where the window previously was to
inactivate Spaces (or inactivate Spaces by pressing the Spaces-
shortcut again) and viola, the window shows up again! This does _not_
happen if you, from Spaces, go to another Space, and then switch to
the Space where the window was before we activated Spaces the first
time.
Is this a bug, or is it something else that should be done to properly
order out the window when in Spaces?
/ Mattias
_______________________________________________
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