summaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com/sun/javafx
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-09-12 21:11:22 -0700
committerSven Gothel <[email protected]>2009-09-12 21:11:22 -0700
commit3ddb06e50c0f841f2f66fb93e1ec41cddd50895e (patch)
treeaf09f1a91cef3e4416bfe8c96c35dbddddabc05f /src/newt/classes/com/sun/javafx
parent4fe426caf55889d17b387efa06551c1af8f0dabe (diff)
Newt: native window parenting MacOSX: OK (but parent clipping is missing) ; X11: windowResize event handled
Diffstat (limited to 'src/newt/classes/com/sun/javafx')
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/Window.java2
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/macosx/MacWindow.java4
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/x11/X11Window.java43
3 files changed, 30 insertions, 19 deletions
diff --git a/src/newt/classes/com/sun/javafx/newt/Window.java b/src/newt/classes/com/sun/javafx/newt/Window.java
index 918e54e1f..49cd49a4d 100755
--- a/src/newt/classes/com/sun/javafx/newt/Window.java
+++ b/src/newt/classes/com/sun/javafx/newt/Window.java
@@ -90,7 +90,7 @@ public abstract class Window implements NativeWindow
Window window = (Window) windowClass.newInstance();
window.invalidate();
window.screen = screen;
- window.setUndecorated(undecorated);
+ window.setUndecorated(undecorated||0!=parentWindowHandle);
window.createNative(parentWindowHandle, caps);
return window;
} catch (Throwable t) {
diff --git a/src/newt/classes/com/sun/javafx/newt/macosx/MacWindow.java b/src/newt/classes/com/sun/javafx/newt/macosx/MacWindow.java
index b3d141c43..277aec796 100755
--- a/src/newt/classes/com/sun/javafx/newt/macosx/MacWindow.java
+++ b/src/newt/classes/com/sun/javafx/newt/macosx/MacWindow.java
@@ -349,7 +349,7 @@ public class MacWindow extends Window {
nsViewLock.lock();
try {
if (windowHandle != 0) {
- setFrameTopLeftPoint(windowHandle, x, y);
+ setFrameTopLeftPoint(parentWindowHandle, windowHandle, x, y);
}
} finally {
nsViewLock.unlock();
@@ -596,5 +596,5 @@ public class MacWindow extends Window {
private native long contentView(long window);
private native long changeContentView(long window, long view);
private native void setContentSize(long window, int w, int h);
- private native void setFrameTopLeftPoint(long window, int x, int y);
+ private native void setFrameTopLeftPoint(long parentWindowHandle, long window, int x, int y);
}
diff --git a/src/newt/classes/com/sun/javafx/newt/x11/X11Window.java b/src/newt/classes/com/sun/javafx/newt/x11/X11Window.java
index aaea78589..57653a6d3 100755
--- a/src/newt/classes/com/sun/javafx/newt/x11/X11Window.java
+++ b/src/newt/classes/com/sun/javafx/newt/x11/X11Window.java
@@ -99,6 +99,11 @@ public class X11Window extends Window {
public void setSize(int width, int height) {
if(0==windowHandle) return;
+ if(!visible) {
+ // set values, since no event roundtrip will happen to set them
+ this.width = width;
+ this.height = height;
+ }
if(!fullscreen) {
nfs_width=width;
nfs_height=height;
@@ -108,6 +113,11 @@ public class X11Window extends Window {
public void setPosition(int x, int y) {
if(0==windowHandle) return;
+ if(!visible) {
+ // set values, since no event roundtrip will happen to set them
+ this.x = x;
+ this.y = y;
+ }
if(!fullscreen) {
nfs_x=x;
nfs_y=y;
@@ -150,24 +160,25 @@ public class X11Window extends Window {
int x, int y, int width, int height, int decorationToggle, boolean setVisible);
private native void setPosition0(long display, long windowHandle, int x, int y);
- private void sizeChanged(int newWidth, int newHeight) {
- width = newWidth;
- height = newHeight;
- if(!fullscreen) {
- nfs_width=width;
- nfs_height=height;
+ private void windowChanged(int newX, int newY, int newWidth, int newHeight) {
+ if(width != newWidth || height != newHeight) {
+ width = newWidth;
+ height = newHeight;
+ if(!fullscreen) {
+ nfs_width=width;
+ nfs_height=height;
+ }
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED);
}
- sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED);
- }
-
- private void positionChanged(int newX, int newY) {
- x = newX;
- y = newY;
- if(!fullscreen) {
- nfs_x=x;
- nfs_y=y;
+ if(x != newX || y != newY) {
+ x = newX;
+ y = newY;
+ if(!fullscreen) {
+ nfs_x=x;
+ nfs_y=y;
+ }
+ sendWindowEvent(WindowEvent.EVENT_WINDOW_MOVED);
}
- sendWindowEvent(WindowEvent.EVENT_WINDOW_MOVED);
}
private void windowCreated(long windowHandle) {