Am Dienstag, den 05.12.2006, 10:42 +0100 schrieb Roman Kennke:
> Am Montag, den 04.12.2006, 15:52 -0500 schrieb Thomas Fitzsimmons:
> > Mark Wielaard wrote:
> > > Hi,
> > > 
> > > With the mauve regressions cleaned up we finally have a branch for 0.93
> > > (tagged as classpath-0_93-branch with classpath-0_93-branch-point as
> > > marker on the trunk). So things todo before release:
> > > 
> > > - sync up generics branch again.
> > > - Run some larger applications as smoke tests
> > >   eclipse, jfreecharts, jedit, megamek, hsql-frontends, some applets,
> > >   etc. to make sure they still run as well as they did with 0.92.
> > >   Reports welcome!
> > 
> > I'm attempting to run MegaMek on cacao + classpath-0_93-branch.  I see many 
> > exceptions like this:
> > 
> > Exception during event dispatch:
> > java.lang.NullPointerException
> >     at 
> > gnu.java.awt.peer.gtk.GtkComponentPeer.paintComponent(GtkComponentPeer.java:316)
> 
> That's my fault. I fix this.

We need to 'coalesce' the paint area from the current event too in the
case when an application bypasses the eventqueue and sends PaintEvents
directly.

2006-12-05  Roman Kennke  <[EMAIL PROTECTED]>

        (paintComponent): Include paint area from event.
        (updateComponent): Include paint area from event.

/Roman

Index: gnu/java/awt/peer/gtk/GtkComponentPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkComponentPeer.java,v
retrieving revision 1.123
diff -u -1 -5 -r1.123 GtkComponentPeer.java
--- gnu/java/awt/peer/gtk/GtkComponentPeer.java	3 Dec 2006 16:01:11 -0000	1.123
+++ gnu/java/awt/peer/gtk/GtkComponentPeer.java	5 Dec 2006 09:55:35 -0000
@@ -301,30 +301,34 @@
 
   // This method and its overrides are the only methods in the peers
   // that should call awtComponent.paint.
   protected void paintComponent (PaintEvent event)
   {
     // Do not call Component.paint if the component is not showing or
     // if its bounds form a degenerate rectangle.
     if (!awtComponent.isShowing()
         || (awtComponent.getWidth() < 1 || awtComponent.getHeight() < 1))
       return;
 
     // Creating and disposing a GdkGraphics every time paint is called
     // seems expensive.  However, the graphics state does not carry
     // over between calls to paint, and resetting the graphics object
     // may even be more costly than simply creating a new one.
+
+    // Make sure that the paintArea includes the area from the event
+    // in the case when an application sends PaintEvents directly.
+    coalescePaintEvent(event);
     Rectangle paintArea;
     synchronized (this)
       {
         paintArea = currentPaintArea;
         currentPaintArea = null;
       }
 
     if (paintArea != null)
       {
         Graphics g = getGraphics();
         try
           {
             g.setClip(paintArea);
             awtComponent.paint(g);
           }
@@ -333,30 +337,33 @@
             g.dispose();
           }
       }
   }
 
   // This method and its overrides are the only methods in the peers
   // that should call awtComponent.update.
   protected void updateComponent (PaintEvent event)
   {
     // Do not call Component.update if the component is not showing or
     // if its bounds form a degenerate rectangle.
     if (!awtComponent.isShowing()
         || (awtComponent.getWidth() < 1 || awtComponent.getHeight() < 1))
       return;
 
+    // Make sure that the paintArea includes the area from the event
+    // in the case when an application sends PaintEvents directly.
+    coalescePaintEvent(event);
     Rectangle paintArea;
     synchronized (this)
       {
         paintArea = currentPaintArea;
         currentPaintArea = null;
       }
 
     if (paintArea != null)
     {
       Graphics g = getGraphics();
       try
         {
           g.setClip(paintArea);
           awtComponent.update(g);
         }

Reply via email to