diff options
Diffstat (limited to 'src/newt/classes/com/sun/javafx')
-rw-r--r-- | src/newt/classes/com/sun/javafx/newt/awt/AWTWindow.java | 20 | ||||
-rw-r--r-- | src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java | 4 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/newt/classes/com/sun/javafx/newt/awt/AWTWindow.java b/src/newt/classes/com/sun/javafx/newt/awt/AWTWindow.java index a425386a3..b3908d759 100644 --- a/src/newt/classes/com/sun/javafx/newt/awt/AWTWindow.java +++ b/src/newt/classes/com/sun/javafx/newt/awt/AWTWindow.java @@ -47,6 +47,7 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.util.*; import com.sun.javafx.newt.Window; +import java.awt.Insets; import javax.media.nativewindow.*; import javax.media.nativewindow.awt.*; @@ -159,9 +160,26 @@ public class AWTWindow extends Window { /** An AWT event on setSize() would bring us in a deadlock situation, hence invokeLater() */ runOnEDT(false, new Runnable() { public void run() { - frame.setSize(width, height); + Insets insets = frame.getInsets(); + frame.setSize(width + insets.left + insets.right, + height + insets.top + insets.bottom); + } + }); + } + + public com.sun.javafx.newt.Insets getInsets() { + final int insets[] = new int[] { 0, 0, 0, 0 }; + runOnEDT(true, new Runnable() { + public void run() { + Insets frameInsets = frame.getInsets(); + insets[0] = frameInsets.top; + insets[1] = frameInsets.left; + insets[2] = frameInsets.bottom; + insets[3] = frameInsets.right; } }); + return new com.sun.javafx.newt. + Insets(insets[0],insets[1],insets[2],insets[3]); } public void setPosition(final int x, final int y) { diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java b/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java index 9f4454681..c5e625186 100644 --- a/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java @@ -339,6 +339,10 @@ public class GLWindow extends Window implements GLAutoDrawable { window.setPosition(x, y); } + public Insets getInsets() { + return window.getInsets(); + } + public boolean setFullscreen(boolean fullscreen) { return window.setFullscreen(fullscreen); } |