--- old/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java 2013-05-30 12:46:51.000000000 +0400 +++ new/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java 2013-05-30 12:46:51.000000000 +0400 @@ -77,8 +77,20 @@ if (!GraphicsEnvironment.isHeadless()) { initIDs(); } + inAWT = AccessController.doPrivileged(new PrivilegedAction() { + @Override + public Boolean run() { + return !Boolean.parseBoolean(System.getProperty("javafx.embed.singleThread", "false")); + } + }); } + /* + * If true we operate in normal mode and nested runloop is executed in JavaRunLoopMode + * If false we operate in singleThreaded FX/AWT interop mode and nested loop uses NSDefaultRunLoopMode + */ + private static final boolean inAWT; + public LWCToolkit() { SunToolkit.setDataTransfererClassName("sun.lwawt.macosx.CDataTransferer"); @@ -701,7 +713,10 @@ * * if false - all events come after exit form the nested loop */ - static native void doAWTRunLoop(long mediator, boolean processEvents); + static void doAWTRunLoop(long mediator, boolean processEvents) { + doAWTRunLoopImpl(mediator, processEvents, inAWT); + } + static private native void doAWTRunLoopImpl(long mediator, boolean processEvents, boolean inAWT); static native void stopAWTRunLoop(long mediator); private native boolean nativeSyncQueue(long timeout);