2002/04/21 16:19:23
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:45:19 +0000 (06:45 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:45:19 +0000 (06:45 +0000)
darcs-hash:20040130064519-2ba56-0b6f1fb57fb3d23dc4ba0b40ed59f6bc2367632d.gz

CHANGES
src/org/xwt/Surface.java

diff --git a/CHANGES b/CHANGES
index 01ca731..7c00770 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -25,3 +25,5 @@
 
 21-Apr megacz src/org/xwt/plat/GCJ.xml: removed -fno-rtti
 
+21-Apr megacz src/org/xwt/Surface.java: workaround for GCJ PR java/6393
+
index 4cc5f59..58339c8 100644 (file)
@@ -258,7 +258,9 @@ public abstract class Surface {
         this.width = width;
         this.height = height;
         abort = true;
-        lastResizeTime = System.currentTimeMillis();
+        long lastResizeTime = System.currentTimeMillis();
+        lastResizeTimeTop = (int)(lastResizeTime >> 32);
+        lastResizeTimeBottom = (int)(lastResizeTime & 0xffffffff);
         Refresh();
     }
 
@@ -274,11 +276,15 @@ public abstract class Surface {
     protected final void Focused(boolean b) { new SimpleMessage("Focused", b ? Boolean.TRUE : Boolean.FALSE, null); }
     public static void Refresh() { MessageQueue.refresh(); }
 
+    // the following value is split into two int's to work around GCJ bug java/6393
+
     /** used in conjunction with Platform.supressDirtyOnResize() */
-    private long lastResizeTime = 0;
+    private int lastResizeTimeTop = 0;
+    private int lastResizeTimeBottom = 0;
 
     /** This is how subclasses signal a 'shallow dirty', indicating that although the backbuffer is valid, the screen is not */
     public final void Dirty(int x, int y, int w, int h) {
+        long lastResizeTime = (((long)lastResizeTimeTop) << 32) | (long)lastResizeTimeBottom;
         if (Platform.supressDirtyOnResize() && System.currentTimeMillis() - lastResizeTime < 100 && (w >= width - 1 || h >= height - 1)) return;
         screenDirtyRegions.dirty(x, y, w, h);
         blitDirtyScreenRegions();