summaryrefslogtreecommitdiffstats
path: root/libjava/gnu/awt/xlib/XFramePeer.java
diff options
context:
space:
mode:
authorsgilbertson <sgilbertson@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-15 16:07:18 +0000
committersgilbertson <sgilbertson@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-15 16:07:18 +0000
commit581d57e6c0faef95b511984510372d09ca55210c (patch)
tree36d9688009aa0d1293f407c7660e7901e7986ce0 /libjava/gnu/awt/xlib/XFramePeer.java
parent53c0d211319a9f957d984f6e40b2828e1c586d47 (diff)
downloadppe42-gcc-581d57e6c0faef95b511984510372d09ca55210c.tar.gz
ppe42-gcc-581d57e6c0faef95b511984510372d09ca55210c.zip
2005-07-15 Scott Gilbertson <scottg@mantatest.com>
* 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
Diffstat (limited to 'libjava/gnu/awt/xlib/XFramePeer.java')
-rw-r--r--libjava/gnu/awt/xlib/XFramePeer.java33
1 files changed, 15 insertions, 18 deletions
diff --git a/libjava/gnu/awt/xlib/XFramePeer.java b/libjava/gnu/awt/xlib/XFramePeer.java
index f3c655ecf80..79f1e88cf28 100644
--- a/libjava/gnu/awt/xlib/XFramePeer.java
+++ b/libjava/gnu/awt/xlib/XFramePeer.java
@@ -22,7 +22,8 @@ import gnu.gcj.xlib.XConfigureEvent;
public class XFramePeer extends XCanvasPeer implements FramePeer
{
-
+ private boolean processingConfigureNotify = false;
+
public XFramePeer(Frame frame)
{
super(frame);
@@ -62,28 +63,24 @@ public class XFramePeer extends XCanvasPeer implements FramePeer
void configureNotify(XConfigureEvent configEvent)
{
+ processingConfigureNotify = true; // to avoid setBounds flood
component.setBounds(configEvent.getBounds());
-
- /* FIXME: Validation should probably not be done here. The best
- strategy is probably to validate on the AWT thread in response
- to an ComponentEvent. This will make it possible to coalesce
- resize validations. */
- component.validate();
+ processingConfigureNotify = false;
}
/* Overridden to ignore request to set bounds if the request occurs
- on the X event loop thread. It is assumed that all requests that
- occur on the X event loop thread are results of XConfigureNotify
- events, in which case the X window already has the desired
- bounds. */
+ while processing an XConfigureNotify event, in which case the X
+ window already has the desired bounds.
+ That's what java.awt.Window.setBoundsCallback is for, but it's
+ package-private, and using our own flag eliminates the need to
+ circumvent java security.
+ */
public void setBounds(int x, int y, int width, int height)
{
- if (EventQueue.isDispatchThread())
- return;
-
- super.setBounds(x, y, width, height);
+ if (!processingConfigureNotify)
+ super.setBounds(x, y, width, height);
}
-
+
// Implementing ContainerPeer:
static final Insets INSETS_0_PROTOTYPE = new Insets(0, 0, 0, 0);
@@ -114,12 +111,12 @@ public class XFramePeer extends XCanvasPeer implements FramePeer
public void toBack()
{
- throw new UnsupportedOperationException("not implemented yet");
+ window.toBack ();
}
public void toFront()
{
- throw new UnsupportedOperationException("not implemented yet");
+ window.toFront ();
}
OpenPOWER on IntegriCloud