jdk/src/macosx/native/sun/awt/LWCToolkit.m
changeset 17899 d3a864bdee7d
parent 15988 6db6e40405cf
child 18274 7c4289125569
--- a/jdk/src/macosx/native/sun/awt/LWCToolkit.m	Fri May 31 19:34:02 2013 +0400
+++ b/jdk/src/macosx/native/sun/awt/LWCToolkit.m	Mon Jun 03 10:14:05 2013 +0400
@@ -295,11 +295,11 @@
 
 /*
  * Class:     sun_lwawt_macosx_LWCToolkit
- * Method:    doAWTRunLoop
+ * Method:    doAWTRunLoopImpl
  * Signature: (JZZ)V
  */
-JNIEXPORT void JNICALL Java_sun_lwawt_macosx_LWCToolkit_doAWTRunLoop
-(JNIEnv *env, jclass clz, jlong mediator, jboolean processEvents)
+JNIEXPORT void JNICALL Java_sun_lwawt_macosx_LWCToolkit_doAWTRunLoopImpl
+(JNIEnv *env, jclass clz, jlong mediator, jboolean processEvents, jboolean inAWT)
 {
 AWT_ASSERT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
@@ -311,7 +311,7 @@
     // Don't use acceptInputForMode because that doesn't setup autorelease pools properly
     BOOL isRunning = true;
     while (![mediatorObject shouldEndRunLoop] && isRunning) {
-        isRunning = [[NSRunLoop currentRunLoop] runMode:[JNFRunLoop javaRunLoopMode]
+        isRunning = [[NSRunLoop currentRunLoop] runMode:(inAWT ? [JNFRunLoop javaRunLoopMode] : NSDefaultRunLoopMode)
                                              beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.010]];
         if (processEvents) {
             //We do not spin a runloop here as date is nil, so does not matter which mode to use
@@ -340,7 +340,6 @@
 JNIEXPORT void JNICALL Java_sun_lwawt_macosx_LWCToolkit_stopAWTRunLoop
 (JNIEnv *env, jclass clz, jlong mediator)
 {
-AWT_ASSERT_NOT_APPKIT_THREAD;
 JNF_COCOA_ENTER(env);
 
     AWTRunLoopObject* mediatorObject = (AWTRunLoopObject*)jlong_to_ptr(mediator);