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/XEventLoop.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'libjava/gnu/awt/xlib/XEventLoop.java') diff --git a/libjava/gnu/awt/xlib/XEventLoop.java b/libjava/gnu/awt/xlib/XEventLoop.java index 149ee736d7c..d0c46a804d5 100644 --- a/libjava/gnu/awt/xlib/XEventLoop.java +++ b/libjava/gnu/awt/xlib/XEventLoop.java @@ -21,12 +21,13 @@ import java.awt.event.InputEvent; import java.awt.event.MouseEvent; import java.util.Vector; -public class XEventLoop +public class XEventLoop implements Runnable { Display display; EventQueue queue; XAnyEvent anyEvent; - + private Thread eventLoopThread; + LightweightRedirector lightweightRedirector = new LightweightRedirector(); public XEventLoop(Display display, EventQueue queue) @@ -35,13 +36,17 @@ public class XEventLoop this.queue = queue; anyEvent = new XAnyEvent(display); + eventLoopThread = new Thread(this, "AWT thread for XEventLoop"); + eventLoopThread.start(); } - void interrupt() + public void run () { - anyEvent.interrupt(); + // FIXME: do we need an interrupt mechanism for window shutdown? + while (true) + postNextEvent (true); } - + /** If there's an event available, post it. * @return true if an event was posted */ @@ -65,7 +70,7 @@ public class XEventLoop AWTEvent event = null; if (loadNextEvent(block)) { - event = createEvent(); + event = createEvent(); event = lightweightRedirector.redirect(event); } return event; -- cgit v1.2.3