diff options
author | Fernando Nasser <fnasser@redhat.com> | 2004-01-19 14:51:54 +0000 |
---|---|---|
committer | Fernando Nasser <fnasser@gcc.gnu.org> | 2004-01-19 14:51:54 +0000 |
commit | aadc6da0c418493c76b3affa3782fcd7ee6a1129 (patch) | |
tree | e514a22de9731c68a1c39c2866ac7fad141dc165 | |
parent | 2c20a17152d3af1ab0788857e6439f1799111183 (diff) | |
download | gcc-aadc6da0c418493c76b3affa3782fcd7ee6a1129.zip gcc-aadc6da0c418493c76b3affa3782fcd7ee6a1129.tar.gz gcc-aadc6da0c418493c76b3affa3782fcd7ee6a1129.tar.bz2 |
EventQueue.java (getCurrentEvent): Consider that system events may be handled by any queue in the stack.
* java/awt/EventQueue.java (getCurrentEvent): Consider that system
events may be handled by any queue in the stack.
From-SVN: r76150
-rw-r--r-- | libjava/ChangeLog | 5 | ||||
-rw-r--r-- | libjava/java/awt/EventQueue.java | 14 |
2 files changed, 17 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 4a17397..cd7d66a 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2004-01-19 Fernando Nasser <fnasser@redhat.com> + + * java/awt/EventQueue.java (getCurrentEvent): Consider that system + events may be handled by any queue in the stack. + 2004-01-19 Kim Ho <kho@redhat.com> * gnu/java/awt/peer/gtk/GtkFramePeer.java (getMenuBarHeight): Added diff --git a/libjava/java/awt/EventQueue.java b/libjava/java/awt/EventQueue.java index 41dad06..4cb0703 100644 --- a/libjava/java/awt/EventQueue.java +++ b/libjava/java/awt/EventQueue.java @@ -293,8 +293,18 @@ public class EventQueue public static AWTEvent getCurrentEvent() { EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue(); - if (Thread.currentThread() != eq.dispatchThread) - return null; + Thread ct = Thread.currentThread(); + + /* Find out if this thread is the dispatch thread for any of the + EventQueues in the chain */ + while (ct != eq.dispatchThread) + { + // Try next EventQueue, if any + if (eq.next == null) + return null; // Not an event dispatch thread + eq = eq.next; + } + return eq.currentEvent; } |