Hi,

As discussed on the main list there was a small bug in
GtkContainerPeer.endValidation(). Top-level windows don't have a parent,
so we have to check whether they are showing themselves. Otherwise some
components would never have their parent and bounds setup.

2006-02-19  Mark Wielaard  <[EMAIL PROTECTED]>

    * gnu/java/awt/peer/gtk/GtkContainerPeer.java (endValidate): Set
    Parent and Bounds of our children if either or parent is showing, or
    we are a Window and are showing ourselves now.

This doesn't help for programs that explicitly want to paint components
in a non-validated Container. But this is good enough to finally be able
to run the hsqldb DatabaseManager:
http://gnu.wildebeest.org/diary/index.php?p=153

Committed,

Mark
Index: gnu/java/awt/peer/gtk/GtkContainerPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkContainerPeer.java,v
retrieving revision 1.32
diff -u -r1.32 GtkContainerPeer.java
--- gnu/java/awt/peer/gtk/GtkContainerPeer.java	19 Aug 2005 01:29:26 -0000	1.32
+++ gnu/java/awt/peer/gtk/GtkContainerPeer.java	19 Feb 2006 22:30:31 -0000
@@ -1,5 +1,5 @@
 /* GtkContainerPeer.java -- Implements ContainerPeer with GTK
-   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2006 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -67,10 +67,13 @@
   {
     Component parent = awtComponent.getParent ();
 
-    // Only set our parent on the GTK side if our parent on the AWT
-    // side is not showing.  Otherwise the gtk peer will be shown
-    // before we've had a chance to position and size it properly.
-    if (parent != null && parent.isShowing ())
+    // We only set our parent on the GTK side if our parent on the AWT
+    // side is not showing in the constuctor.  Otherwise the gtk peer will
+    // be shown  before we've had a chance to position and size it properly.
+    // So we set it here at the end of validation.
+    if ((parent != null && parent.isShowing())
+	|| (awtComponent instanceof Window
+	    && ((Window) awtComponent).isShowing()))
       {
         Component[] components = ((Container) awtComponent).getComponents ();
         int ncomponents = components.length;

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to