* java/awt/EventQueue.java (getCurrentEvent): Consider that system
events may be handled by any queue in the stack.
From-SVN: r76150
+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
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;
}