don't make a modally run window the main window

This commit is contained in:
Klaas Pieter Annema committed 2010-10-06 09:04:54 +02:00
1 parent b430e2ef65
commit e78200838f
2 files changed
+26 -1

No files matched your search

+2 -1
View File
@@ -507,7 +507,8 @@ CPRunContinuesResponse = -1002;
var theWindow = aModalSession._window;
[theWindow center];
[theWindow makeKeyAndOrderFront:self];
[theWindow makeKeyWindow];
[theWindow orderFront:self];
// [theWindow._bridge _obscureWindowsBelowModalWindow];
+24
View File
@@ -0,0 +1,24 @@
@import <AppKit/CPApplication.j>
@import <AppKit/CPWindow.j>
@implementation CPApplicationTest : OJTestCase
{
}
- (void)setUp
{
// This sets up the CPApp convenience variable, the unit tests fails
// if this is not done, because the framework internally uses CPApp.
[CPApplication sharedApplication]
}
- (void)testRunModalForWindow
{
var aWindow = [[CPWindow alloc] init];
[[CPApplication sharedApplication] runModalForWindow:aWindow];
[self assertTrue:[aWindow isKeyWindow] message:@"A window must be made key when it's run modally"];
[self assertFalse:[aWindow isMainWindow] message:@"A window must not become the main window when it's run modally"];
}
@end