mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-10 10:31:39 +01:00
log LWCToolkit invokeAndWait requests
as part of JBR-3017, to make investigation of similar issues simpler in the future (cherry-picked from commita7fd723e43) (cherry picked from commitd8ca0763a5)
This commit is contained in:
@@ -109,6 +109,7 @@ import sun.lwawt.LWWindowPeer.PeerType;
|
||||
import sun.lwawt.PlatformComponent;
|
||||
import sun.lwawt.PlatformDropTarget;
|
||||
import sun.lwawt.PlatformWindow;
|
||||
import sun.util.logging.PlatformLogger;
|
||||
|
||||
@SuppressWarnings("serial") // JDK implementation class
|
||||
final class NamedCursor extends Cursor {
|
||||
@@ -175,10 +176,11 @@ public final class LWCToolkit extends LWToolkit {
|
||||
= !Boolean.parseBoolean(
|
||||
System.getProperty("javafx.embed.singleThread", "false"));
|
||||
|
||||
private static final PlatformLogger log = PlatformLogger.getLogger("sun.lwawt.macosx.LWCToolkit");
|
||||
|
||||
public LWCToolkit() {
|
||||
final String extraButtons = "sun.awt.enableExtraMouseButtons";
|
||||
areExtraMouseButtonsEnabled =
|
||||
Boolean.parseBoolean(System.getProperty(extraButtons, "true"));
|
||||
areExtraMouseButtonsEnabled = Boolean.parseBoolean(System.getProperty(extraButtons, "true"));
|
||||
//set system property if not yet assigned
|
||||
System.setProperty(extraButtons, "" + areExtraMouseButtonsEnabled);
|
||||
initAppkit(ThreadGroupUtils.getRootThreadGroup(),
|
||||
@@ -673,6 +675,11 @@ public final class LWCToolkit extends LWToolkit {
|
||||
if (e != null) throw e;
|
||||
return object;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CallableWrapper{" + callable + "}";
|
||||
}
|
||||
}
|
||||
|
||||
private static final AtomicInteger blockingRunLoopCounter = new AtomicInteger(0);
|
||||
@@ -710,6 +717,10 @@ public final class LWCToolkit extends LWToolkit {
|
||||
public static void invokeAndWait(Runnable runnable, Component component)
|
||||
throws InvocationTargetException
|
||||
{
|
||||
if (log.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
log.fine("invokeAndWait started: " + runnable);
|
||||
}
|
||||
|
||||
boolean nonBlockingRunLoop;
|
||||
|
||||
synchronized (priorityInvocationPending) {
|
||||
@@ -744,6 +755,10 @@ public final class LWCToolkit extends LWToolkit {
|
||||
doAWTRunLoop(mediator, nonBlockingRunLoop);
|
||||
if (!nonBlockingRunLoop) blockingRunLoopCounter.decrementAndGet();
|
||||
|
||||
if (log.isLoggable(PlatformLogger.Level.FINE)) {
|
||||
log.fine("invokeAndWait finished: " + runnable);
|
||||
}
|
||||
|
||||
checkException(invocationEvent);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user