prioritize any edt activity

because when a user clicks somewhere (an InputEvent is posted, but not yet dispatched),
but EDT is busy, it should finish its activities ASAP
This commit is contained in:
peter
2016-12-01 20:07:11 +01:00
parent be0602878d
commit ed4fcbcd86
@@ -355,14 +355,10 @@ public class IdeEventQueue extends EventQueue {
boolean wasInputEvent = myIsInInputEvent;
myIsInInputEvent = isInputEvent(e);
if (myIsInInputEvent) {
HeavyProcessLatch.INSTANCE.prioritizeUiActivity();
} else {
HeavyProcessLatch.INSTANCE.stopThreadPrioritizing();
}
AWTEvent oldEvent = myCurrentEvent;
myCurrentEvent = e;
HeavyProcessLatch.INSTANCE.prioritizeUiActivity();
try (AccessToken ignored = startActivity(e)) {
_dispatchEvent(e, false);
}
@@ -370,6 +366,7 @@ public class IdeEventQueue extends EventQueue {
processException(t);
}
finally {
HeavyProcessLatch.INSTANCE.stopThreadPrioritizing();
myIsInInputEvent = wasInputEvent;
myCurrentEvent = oldEvent;