changeset 20142:43a46d7366ab

8024839: [Unified Swing/Fx threading] don't schedule an event dispatching from the event dispatch thread Reviewed-by: anthony, pchelko
author ant
date Wed, 18 Sep 2013 12:25:13 +0400
parents 2ed60881f2a1
children c8d62571d319
files jdk/src/share/classes/java/awt/EventQueue.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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() {