2003/08/14 05:16:09
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:04:26 +0000 (07:04 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:04:26 +0000 (07:04 +0000)
darcs-hash:20040130070426-2ba56-fe3d8655f58be2543bd6586c885f01def8c34741.gz

src/org/xwt/plat/AWT.java
src/org/xwt/plat/Java2.java

index 8428444..5d46570 100644 (file)
@@ -233,9 +233,9 @@ public class AWT extends Platform {
                 Rectangle r = gr.getClipBounds();
 
                 // ugly hack for Java1.4 dynamicLayout on Win32 -- this catches expansions during smooth resize
-                int newwidth = Math.max(r.x - insets.left + r.width, width);
-                int newheight = Math.max(r.y - insets.top + r.height, height);
-                if (newwidth > width || newheight > height)
+                int newwidth = Math.max(r.x - insets.left + r.width, root.width);
+                int newheight = Math.max(r.y - insets.top + r.height, root.height);
+                if (newwidth > root.width || newheight > root.height)
                     componentResized(window.getWidth() - insets.left - insets.right, window.getHeight() - insets.top - insets.bottom);
 
                 Dirty(r.x - insets.left, r.y - insets.top, r.width, r.height);
@@ -322,7 +322,7 @@ public class AWT extends Platform {
         public void windowClosed(WindowEvent e) { }
         public void windowClosing(WindowEvent e) { Close(); }
         public void windowIconified(WindowEvent e) { Minimized(true); }
-        public void windowDeiconified(WindowEvent e) { dirty(0, 0, width, height); Minimized(false); }
+        public void windowDeiconified(WindowEvent e) { dirty(0, 0, root.width, root.height); Minimized(false); }
         public void windowActivated(WindowEvent e) { Focused(true); }
         public void windowDeactivated(WindowEvent e) { Focused(false); }
     public void componentMoved(ComponentEvent e) { PosChange(window.getLocation().x + insets.left, window.getLocation().y + insets.top); }
@@ -334,8 +334,8 @@ public class AWT extends Platform {
         }
 
         public void componentResized(int newwidth, int newheight) {
-            int oldwidth = width;
-            int oldheight = height;
+            int oldwidth = root.width;
+            int oldheight = root.height;
             SizeChange(newwidth, newheight);
 
             // we do this because JVMs which don't clear the background won't force repaints of these areas
@@ -356,7 +356,7 @@ public class AWT extends Platform {
             // ugly hack for Java1.4 dynamicLayout on Win32 -- this catches contractions during smooth resize
             int newwidth = window.getWidth() - insets.left - insets.right;
             int newheight = window.getHeight() - insets.top - insets.bottom;
-            if (newwidth != width || newheight != height) componentResized(newwidth, newheight);
+            if (newwidth != root.width || newheight != root.height) componentResized(newwidth, newheight);
             
             Move(m.getX() - insets.left, m.getY() - insets.top);
         }
index 9b413ff..f855961 100644 (file)
@@ -18,7 +18,8 @@ public class Java2 extends AWT {
 
     private boolean isJava14 = false;
     protected boolean _supressDirtyOnResize() {
-        return (isJava14 && !System.getProperty("os.name", "").equals("Mac OS X"))? false : true;
+        return false;
+        //return (isJava14 && !System.getProperty("os.name", "").equals("Mac OS X"))? false : true;
     }
 
     public Java2() {
@@ -26,6 +27,7 @@ public class Java2 extends AWT {
         String versionString = System.getProperty("java.version", "");
         int secondDecimal = versionString.substring(versionString.indexOf('.') + 1).indexOf('.');
         if (secondDecimal != -1) versionString = versionString.substring(0, secondDecimal);
+        /*
         double version = Double.parseDouble(versionString);
         if (version >= 1.4) {
             isJava14 = true;
@@ -38,6 +40,7 @@ public class Java2 extends AWT {
                 Log.log(this, e);
             }
         }
+        */
         javax.swing.FocusManager.setCurrentManager(new javax.swing.FocusManager() {
                 public void processKeyEvent(Component focusedComponent, KeyEvent anEvent) { }
                 public void focusPreviousComponent(Component aComponent) { }
@@ -137,11 +140,11 @@ public class Java2 extends AWT {
         public void blit(DoubleBuffer s, int sx, int sy, int dx, int dy, int dx2, int dy2) {
             if (ourGraphics == null) {
                 ourGraphics = window.getGraphics();
-
+                
                 // sometimes jdk1.4 doesn't set the clip properly when we're in the middle of a resize
-                ourGraphics.setClip(insets.left, insets.top, width + insets.left, height + insets.top);
+                ourGraphics.setClip(insets.left, insets.top, root.width + insets.left, root.height + insets.top);
             }
-            _doDrawImage(ourGraphics, ((AWTDoubleBuffer)s).i, dx + insets.left, dy + insets.top, dx2 + insets.left, dy2 + insets.top,
+            _doDrawImage(window.getGraphics(), ((AWTDoubleBuffer)s).i, dx + insets.left, dy + insets.top, dx2 + insets.left, dy2 + insets.top,
                          sx, sy, sx + (dx2 - dx), sy + (dy2 - dy), null);
         }