From 581d57e6c0faef95b511984510372d09ca55210c Mon Sep 17 00:00:00 2001 From: sgilbertson Date: Fri, 15 Jul 2005 16:07:18 +0000 Subject: 2005-07-15 Scott Gilbertson * gnu/awt/xlib/XCanvasPeer.java (attributes): New field. (eventMask): New field. (XCanvasPeer(Component)): Use attributes field. (setBackground): Implemented. (setEventMask): Process mask only if changed. * gnu/awt/xlib/XEventLoop.java (class): Iplement Runnable. (eventLoopThread): New field. (XEventLoop(Display,EventQueue)): Start eventLoopThread. (interrupt): Removed. (run): New method. * gnu/awt/xlib/XEventQueue.java (getNextEvent): Process Container and Component events. * gnu/awt/xlib/XFramePeer.java (processingConfigureNotify): New field. (configureNotify): Set and clear processingConfigureNotify. (setBounds): Process only if processingConfigureNotify is false. (toBack): Implemented. (toFront): Implemented. * gnu/awt/xlib/XGraphics.java (setColor): Ignore null color. * gnu/awt/xlib/XGraphicsConfiguration.java (getPixel): Ignore null color. * gnu/awt/xlib/XToolkit.java (nativeQueueEmpty): Always return true. (wakeNativeQueue): Do nothing. (iterateNativeQueue): Do queue.wait if blocking. * gnu/gcj/xlib/Font.java (loadFont): New method. (loadFontImpl): Renamed native method, was loadFont. * gnu/gcj/xlib/Window.java (toFront): New method. (toBack): New method. * gnu/gcj/xlib/natFont.cc (loadFontImpl): Renamed method, was loadFont. * gnu/gcj/xlib/natWindow.cc (toBack): New method. (toFront): New method. * gnu/gcj/xlib/natXAnyEvent.cc (loadNext): Removed timeout. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102057 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/gnu/awt/xlib/XToolkit.java | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'libjava/gnu/awt/xlib/XToolkit.java') 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 + } + } + }; } -- cgit v1.2.3