We must activate newEventsOnly when a ContainerListener is added to a
Container, in order to get ContainerEvents dispatched properly. This
fixes a Mauve regression.

2006-09-27  Roman Kennke  <[EMAIL PROTECTED]>

        * java/awt/Container.java
        (addContainerListener): Activate newEventsOnly for the component.
        Ignore null listeners.

/Roman
Index: java/awt/Container.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Container.java,v
retrieving revision 1.108
diff -u -1 -5 -r1.108 Container.java
--- java/awt/Container.java	22 Sep 2006 12:27:11 -0000	1.108
+++ java/awt/Container.java	27 Sep 2006 20:59:13 -0000
@@ -935,31 +935,36 @@
    */
   public void printComponents(Graphics g)
   {
     super.paint(g);
     visitChildren(g, GfxPrintAllVisitor.INSTANCE, true);
   }
 
   /**
    * Adds the specified container listener to this object's list of
    * container listeners.
    *
    * @param listener The listener to add.
    */
   public synchronized void addContainerListener(ContainerListener listener)
   {
-    containerListener = AWTEventMulticaster.add(containerListener, listener);
+    if (listener != null)
+      {
+        containerListener = AWTEventMulticaster.add(containerListener,
+                                                    listener);
+        newEventsOnly = true;
+      }
   }
 
   /**
    * Removes the specified container listener from this object's list of
    * container listeners.
    *
    * @param listener The listener to remove.
    */
   public synchronized void removeContainerListener(ContainerListener listener)
   {
     containerListener = AWTEventMulticaster.remove(containerListener, listener);
   }
 
   /**
    * @since 1.4

Reply via email to