Commit aadc6da0 by Fernando Nasser Committed by Fernando Nasser

EventQueue.java (getCurrentEvent): Consider that system events may be handled by…

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
parent 2c20a171
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> 2004-01-19 Kim Ho <kho@redhat.com>
* gnu/java/awt/peer/gtk/GtkFramePeer.java (getMenuBarHeight): Added * gnu/java/awt/peer/gtk/GtkFramePeer.java (getMenuBarHeight): Added
......
...@@ -293,8 +293,18 @@ public class EventQueue ...@@ -293,8 +293,18 @@ public class EventQueue
public static AWTEvent getCurrentEvent() public static AWTEvent getCurrentEvent()
{ {
EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue(); EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
if (Thread.currentThread() != eq.dispatchThread) Thread ct = Thread.currentThread();
return null;
/* 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; return eq.currentEvent;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment