提交 120c2766 编写于 作者: A anthony

7132692: [macosx] Class com.apple.eawt not functioning

Summary: Postpone setting the application delegate until the app is fully initialized
Reviewed-by: art
上级 65f243f0
......@@ -306,6 +306,18 @@ AWT_ASSERT_APPKIT_THREAD;
// AWT gets here AFTER +[AWTStarter appKitIsRunning:] is called.
if (verbose) AWT_DEBUG_LOG(@"got out of the AppKit startup mutex");
}
// Don't set the delegate until the NSApplication has been created and
// its finishLaunching has initialized it.
// ApplicationDelegate is the support code for com.apple.eawt.
void (^setDelegateBlock)() = ^(){
OSXAPP_SetApplicationDelegate([ApplicationDelegate sharedDelegate]);
};
if (onMainThread) {
setDelegateBlock();
} else {
[JNFRunLoop performOnMainThreadWaiting:YES withBlock:setDelegateBlock];
}
}
- (void)starter:(NSArray*)args {
......@@ -340,10 +352,6 @@ AWT_ASSERT_APPKIT_THREAD;
// AppKit Application.
NSApplication *app = [NSApplicationAWT sharedApplication];
// Don't set the delegate until the NSApplication has been created.
// ApplicationDelegate is the support code for com.apple.eawt.
OSXAPP_SetApplicationDelegate([ApplicationDelegate sharedDelegate]);
// AWT gets to this point BEFORE NSApplicationDidFinishLaunchingNotification is sent.
if (![app isRunning]) {
if (verbose) AWT_DEBUG_LOG(@"+[AWTStarter startAWT]: ![app isRunning]");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册