fixed bugs 480 and 488
[org.ibex.core.git] / src / org / ibex / plat / AWT.java
index c247a97..c7a1dce 100644 (file)
@@ -324,13 +324,17 @@ public class AWT extends JVM {
 
         public void setMinimumSize(int minx, int miny, boolean resizable) { if (frame != null) frame.setResizable(resizable); }
 
+        private int oldfill = 0x0;
         public void render() {
             // useful optimizatin;
-            window.setBackground((root.fillcolor & 0xFF000000) == 0 ?
-                                 Color.white :
-                                 new Color((root.fillcolor >> 16) & 0xff,
-                                           (root.fillcolor >> 8) & 0xff,
-                                           (root.fillcolor) & 0xff));
+            if (oldfill != root.fillcolor) {
+                oldfill = root.fillcolor;
+                window.setBackground((root.fillcolor & 0xFF000000) == 0 ?
+                                     Color.white :
+                                     new Color((root.fillcolor >> 16) & 0xff,
+                                               (root.fillcolor >> 8) & 0xff,
+                                               (root.fillcolor) & 0xff));
+            }
             super.render();
         }