8024839: [Unified Swing/Fx threading] don't schedule an event dispatching from the event dispatch thread
Reviewed-by: anthony, pchelko
--- a/jdk/src/share/classes/java/awt/EventQueue.java Mon Sep 16 15:43:06 2013 -0400
+++ b/jdk/src/share/classes/java/awt/EventQueue.java Wed Sep 18 12:25:13 2013 +0400
@@ -690,7 +690,10 @@
final Object src = event.getSource();
final PrivilegedAction<Void> action = new PrivilegedAction<Void>() {
public Void run() {
- if (fwDispatcher == null) {
+ // In case fwDispatcher is installed and we're already on the
+ // dispatch thread (e.g. performing DefaultKeyboardFocusManager.sendMessage),
+ // dispatch the event straight away.
+ if (fwDispatcher == null || isDispatchThreadImpl()) {
dispatchEventImpl(event, src);
} else {
fwDispatcher.scheduleDispatch(new Runnable() {