summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-10-09 17:12:33 +0200
committerSven Gothel <[email protected]>2013-10-09 17:12:33 +0200
commite96b2d648e7d69b95325fb6b80c6eb508e1e8a14 (patch)
tree3f9d4cccf811251672a8d9c73e9b8be624e3f018
parent364af76f2ba3e05ba041997e97f4e342fd6f5827 (diff)
NEWT Reparent/Fullscreen: Add 'waitForPosition(..)' when reparenting or back from fullscreen; JOGLNewtAppletBase: Reparent to pos 32/32, trying to avoid browser window focus/top stealing on X11.
-rwxr-xr-xmake/scripts/make.jogl.all.macosx-clang.sh1
-rwxr-xr-xmake/scripts/make.jogl.all.macosx-java7.sh22
-rwxr-xr-xmake/scripts/make.jogl.all.macosx.sh1
-rw-r--r--make/scripts/tests.sh4
-rw-r--r--src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java13
-rw-r--r--src/newt/classes/jogamp/newt/WindowImpl.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03a.java1
7 files changed, 25 insertions, 29 deletions
diff --git a/make/scripts/make.jogl.all.macosx-clang.sh b/make/scripts/make.jogl.all.macosx-clang.sh
index af9f1e1fe..eb633f5a6 100755
--- a/make/scripts/make.jogl.all.macosx-clang.sh
+++ b/make/scripts/make.jogl.all.macosx-clang.sh
@@ -5,6 +5,7 @@ if [ -e /opt-share/etc/profile.ant ] ; then
fi
JAVA_HOME=`/usr/libexec/java_home -version 1.7`
+#JAVA_HOME=`/usr/libexec/java_home -version 1.6`
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME PATH
diff --git a/make/scripts/make.jogl.all.macosx-java7.sh b/make/scripts/make.jogl.all.macosx-java7.sh
deleted file mode 100755
index ee82bbc91..000000000
--- a/make/scripts/make.jogl.all.macosx-java7.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#! /bin/sh
-
-if [ -e /opt-share/etc/profile.ant ] ; then
- . /opt-share/etc/profile.ant
-fi
-
-
-# -Dc.compiler.debug=true \
-# -Djavacdebug="true" \
-# -Djavacdebuglevel="source,lines,vars" \
-#
-
-JAVA_HOME=`/usr/libexec/java_home -version 1.7`
-PATH=$JAVA_HOME/bin:$PATH
-export JAVA_HOME PATH
-
-#export JOGAMP_JAR_CODEBASE="Codebase: *.jogamp.org"
-export JOGAMP_JAR_CODEBASE="Codebase: *.goethel.localnet"
-
-ant \
- -Drootrel.build=build-macosx-java7 \
- $* 2>&1 | tee make.jogl.all.macosx-java7.log
diff --git a/make/scripts/make.jogl.all.macosx.sh b/make/scripts/make.jogl.all.macosx.sh
index c80b41d1d..0c7fd7842 100755
--- a/make/scripts/make.jogl.all.macosx.sh
+++ b/make/scripts/make.jogl.all.macosx.sh
@@ -5,6 +5,7 @@ if [ -e /opt-share/etc/profile.ant ] ; then
fi
JAVA_HOME=`/usr/libexec/java_home -version 1.7`
+#JAVA_HOME=`/usr/libexec/java_home -version 1.6`
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME PATH
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 9ca5374e4..023d37d74 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -299,7 +299,7 @@ function testawtswt() {
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelsAWT $*
-#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT $*
+testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NewtCanvasAWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NEWT $*
@@ -456,7 +456,7 @@ function testawtswt() {
#testawt com.jogamp.opengl.test.junit.jogl.acore.TestShutdownCompleteAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.acore.x11.TestGLXCallsOnAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug816OSXCALayerPos01AWT $*
-testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug816OSXCALayerPos02AWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug816OSXCALayerPos02AWT $*
#testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug816OSXCALayerPos03aAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug816OSXCALayerPos03bAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug816OSXCALayerPos03cAWT $*
diff --git a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java
index 25ddfad48..1004adb8e 100644
--- a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java
+++ b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java
@@ -33,6 +33,7 @@ import java.security.PrivilegedAction;
import javax.media.nativewindow.NativeWindow;
import javax.media.nativewindow.WindowClosingProtocol.WindowClosingMode;
+import javax.media.nativewindow.util.InsetsImmutable;
import javax.media.opengl.FPSCounter;
import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;
@@ -301,7 +302,17 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
if(null == glWindow.getParent()) {
glWindow.reparentWindow(awtParent);
} else {
- glWindow.reparentWindow(null);
+ final InsetsImmutable insets = glWindow.getInsets();
+ final int x, y;
+ if ( 0 >= insets.getTopHeight() ) {
+ // fail safe ..
+ x = 32;
+ y = 32;
+ } else {
+ x = insets.getLeftWidth();
+ y = insets.getTopHeight();
+ }
+ glWindow.reparentWindow(null, x, y, false /* forceDestroyCreate */);
glWindow.setDefaultCloseOperation( glClosable ? WindowClosingMode.DISPOSE_ON_CLOSE : WindowClosingMode.DO_NOTHING_ON_CLOSE );
}
}
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index 300ca5c3f..b7357863f 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -1343,6 +1343,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
ok = WindowImpl.this.waitForSize(width, height, false, TIMEOUT_NATIVEWINDOW);
}
if(ok) {
+ ok = WindowImpl.this.waitForPosition(true, x, y, TIMEOUT_NATIVEWINDOW);
+ }
+ if(ok) {
requestFocusInt( 0 == parentWindowHandle /* skipFocusAction if top-level */);
display.dispatchMessagesNative(); // status up2date
}
@@ -1375,7 +1378,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
if(DEBUG_IMPLEMENTATION) {
- System.err.println("Window.reparentWindow: END-1 ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight());
+ System.err.println("Window.reparent: END-1 ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight());
}
} finally {
if(null!=lifecycleHook) {
@@ -1399,7 +1402,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
}
if(DEBUG_IMPLEMENTATION) {
- System.err.println("Window.reparentWindow: END-X ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight());
+ System.err.println("Window.reparent: END-X ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight());
}
}
}
@@ -1410,7 +1413,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
_lock.lock();
try {
if(DEBUG_IMPLEMENTATION) {
- System.err.println("Window.reparentWindow: ReparentActionRecreate ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+Display.hashCodeNullSafe(parentWindow));
+ System.err.println("Window.reparent: ReparentActionRecreate ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+Display.hashCodeNullSafe(parentWindow));
}
setVisibleActionImpl(true); // native creation
requestFocusInt( 0 == parentWindowHandle /* skipFocusAction if top-level */);
@@ -2020,6 +2023,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(ok) {
ok = WindowImpl.this.waitForSize(w, h, false, TIMEOUT_NATIVEWINDOW);
}
+ if(ok && !fullscreen) {
+ ok = WindowImpl.this.waitForPosition(true, x, y, TIMEOUT_NATIVEWINDOW);
+ }
if(ok) {
requestFocusInt(fullscreen /* skipFocusAction if fullscreen */);
display.dispatchMessagesNative(); // status up2date
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03a.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03a.java
index a70625129..a0ce938fe 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03a.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03a.java
@@ -29,7 +29,6 @@ package com.jogamp.opengl.test.junit.jogl.demos.es2.awt;
import java.applet.Applet;
import java.awt.BorderLayout;
-import java.awt.Button;
import javax.media.opengl.GLAnimatorControl;
import javax.media.opengl.GLCapabilities;