summaryrefslogtreecommitdiffstats
path: root/libjava/gnu/awt/xlib/XToolkit.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/gnu/awt/xlib/XToolkit.java')
-rw-r--r--libjava/gnu/awt/xlib/XToolkit.java25
1 files changed, 20 insertions, 5 deletions
diff --git a/libjava/gnu/awt/xlib/XToolkit.java b/libjava/gnu/awt/xlib/XToolkit.java
index c6e140eb3e1..87acec3e349 100644
--- a/libjava/gnu/awt/xlib/XToolkit.java
+++ b/libjava/gnu/awt/xlib/XToolkit.java
@@ -445,13 +445,16 @@ public class XToolkit extends ClasspathToolkit
}
public boolean nativeQueueEmpty()
- {
- return eventLoop.isIdle();
+ {
+ // Tell EventQueue the native queue is empty, because XEventLoop
+ // separately ensures that native events are posted to AWT.
+ return true;
}
public void wakeNativeQueue()
{
- eventLoop.interrupt();
+ // Not implemented, because the native queue is always awake.
+ // (i.e. it's polled in a thread separate from the AWT dispatch thread)
}
/** Checks the native event queue for events. If blocking, waits until an
@@ -464,6 +467,18 @@ public class XToolkit extends ClasspathToolkit
*/
public void iterateNativeQueue(java.awt.EventQueue locked, boolean block)
{
- eventLoop.postNextEvent(block);
- }
+ // There is nothing to do here except block, because XEventLoop
+ // iterates the queue in a dedicated thread.
+ if (block)
+ {
+ try
+ {
+ queue.wait ();
+ }
+ catch (InterruptedException ie)
+ {
+ // InterruptedException intentionally ignored
+ }
+ }
+ };
}
OpenPOWER on IntegriCloud