mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-24 11:24:05 +08:00
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
This commit is contained in:
parent
2c20a17152
commit
aadc6da0c4
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user