2003/09/24 07:33:32
[org.ibex.core.git] / src / org / xwt / plat / AWT.java
index 6850927..6fe9be4 100644 (file)
@@ -20,9 +20,10 @@ public class AWT extends JVM {
     protected int _getScreenWidth() { return Toolkit.getDefaultToolkit().getScreenSize().width; }
     protected int _getScreenHeight() { return Toolkit.getDefaultToolkit().getScreenSize().height; }
     protected Surface _createSurface(Box b, boolean framed) { return new AWTSurface(b, framed); }
-    protected boolean _supressDirtyOnResize() { return false; }
 
     protected void postInit() {
+        System.setProperty("com.apple.mrj.application.live-resize", "true");
+        System.setProperty("com.apple.mrj.application.growbox.intrudes", "false");
         if (Log.on) Log.log(Platform.class, "               color depth = " + Toolkit.getDefaultToolkit().getColorModel().getPixelSize() + "bpp");
     }
 
@@ -108,7 +109,7 @@ public class AWT extends JVM {
         final Semaphore s = new Semaphore();
         FileDialogHelper fd = new FileDialogHelper(suggestedFileName, s, write);
         s.block();
-        return fd.getDirectory() + File.separatorChar + fd.getFile();
+        return fd.getDirectory() == null ? null : (fd.getDirectory() + File.separatorChar + fd.getFile());
     }
 
 
@@ -181,7 +182,12 @@ public class AWT extends JVM {
 
         public void blit(PixelBuffer s, int sx, int sy, int dx, int dy, int dx2, int dy2) {
             if (ourGraphics == null) ourGraphics = window.getGraphics();
-            ourGraphics.drawImage(((AWTPixelBuffer)s).i, dx + insets.left, dy + insets.top, dx2 + insets.left, dy2 + insets.top,
+            insets = (frame == null ? window : frame).getInsets();
+            ourGraphics.drawImage(((AWTPixelBuffer)s).i,
+                                  dx + insets.left,
+                                  dy + insets.top,
+                                  dx2 + insets.left,
+                                  dy2 + insets.top,
                                   sx, sy, sx + (dx2 - dx), sy + (dy2 - dy), null);
         }
         
@@ -314,7 +320,7 @@ public class AWT extends JVM {
         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); }
+        public void componentMoved(ComponentEvent e) { PosChange(window.getLocation().x + insets.left, window.getLocation().y + insets.top); }
 
         public void componentResized(ComponentEvent e) {
             // we have to periodically do this; I don't know why
@@ -374,7 +380,7 @@ public class AWT extends JVM {
             case KeyEvent.VK_F3: return "f3";
             case KeyEvent.VK_F4: return "f4";
             case KeyEvent.VK_F5: return "f5";
-            case KeyEvent.VK_F6: return "f6";
+            case KeyEvent.VK_F6: return "f6"; 
             case KeyEvent.VK_F7: return "f7";
             case KeyEvent.VK_F8: return "f8";
             case KeyEvent.VK_F9: return "f9";