aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-10-05 03:27:44 +0200
committerSven Gothel <[email protected]>2012-10-05 03:27:44 +0200
commit84632ca22d112da45b807299d2b1f5e4f4107695 (patch)
treec55ffc06de0a098f8a68aea1443983570b0023a1
parenta44c2df78f708b315ab68dbee2c68448e2cc6e7e (diff)
Fix SWTEDTUtil bug, where it simply doesn't start by an implicit 'invoke()' - No NewtCanvasSWT resize, nor input event delivery.
A new EDTUtil instance is not started automatically. Since SWTEDTUtil is attached to the DisplayImpl later in time, i.e. after it's native creation, there is no EDTUtil.invoke(..) call which started it. The not started SWTEDTUtil could not deliver any events. Fix: Start it explicitly - add API doc comment in Display.setEDTUtil(..)
-rwxr-xr-xmake/scripts/tests.sh6
-rw-r--r--src/newt/classes/com/jogamp/newt/Display.java8
-rw-r--r--src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java9
3 files changed, 18 insertions, 5 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 5d12475a5..affa130fb 100755
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -104,7 +104,7 @@ function jrun() {
#D_ARGS="-Djogl.debug.GLContext -Djogl.debug.GLProfile"
#D_ARGS="-Djogl.debug.GLProfile"
#D_ARGS="-Dnativewindow.debug.NativeWindow"
- #D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Display -Dnewt.debug.EDT"
+ D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Display -Dnewt.debug.EDT"
#D_ARGS="-Dnewt.debug.EDT -Dnewt.debug.Window -Djogl.debug.GLContext"
#D_ARGS="-Dnativewindow.debug.X11Util.XErrorStackDump -Dnativewindow.debug.X11Util.TraceDisplayLifecycle -Dnativewindow.debug.X11Util"
#D_ARGS="-Dnativewindow.debug.X11Util -Djogl.debug.GLContext -Djogl.debug.GLDrawable -Dnewt.debug=all"
@@ -238,7 +238,7 @@ function testawtswt() {
#testnoawt com.jogamp.newt.opengl.GLWindow $*
#testnoawt com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen01GLPBufferNEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.offscreen.TestOffscreen02BitmapNEWT $*
-testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestElektronenMultipliziererNEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestFloatUtil01MatrixMatrixMultNOUI $*
#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestPMVMatrix01NEWT $*
@@ -355,7 +355,7 @@ testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
#testawtswt com.jogamp.opengl.test.junit.jogl.swt.TestSWTEclipseGLCanvas01GLn $*
#testawtswt com.jogamp.opengl.test.junit.jogl.swt.TestSWTAccessor03AWTGLn $*
#testawtswt com.jogamp.opengl.test.junit.jogl.swt.TestSWTJOGLGLCanvas01GLn $*
-#testawtswt com.jogamp.opengl.test.junit.jogl.swt.TestNewtCanvasSWTGLn $*
+testawtswt com.jogamp.opengl.test.junit.jogl.swt.TestNewtCanvasSWTGLn $*
#
# newt.awt (testawt)
diff --git a/src/newt/classes/com/jogamp/newt/Display.java b/src/newt/classes/com/jogamp/newt/Display.java
index 391bccf3d..de1d58068 100644
--- a/src/newt/classes/com/jogamp/newt/Display.java
+++ b/src/newt/classes/com/jogamp/newt/Display.java
@@ -164,6 +164,14 @@ public abstract class Display {
* If <code>newEDTUtil</code> is not null and equals the previous one,
* <code>null</code> is returned and no change is being made.
* </p>
+ * <p>
+ * Note that <code>newEDTUtil</code> will not be started if not done so already,
+ * to do so you may issue {@link EDTUtil#invoke(boolean, Runnable) invoke}
+ * on the new EDTUtil:
+ * <pre>
+ * newEDTUtil.invoke(true, new Runnable() { public void run() { } } );
+ * </pre>
+ * </p>
*/
public abstract EDTUtil setEDTUtil(EDTUtil newEDTUtil);
diff --git a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
index 36bc3f28f..74611706a 100644
--- a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
+++ b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
@@ -325,8 +325,13 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
final int w = clientArea.width;
final int h = clientArea.height;
- final Display newtDisplay = newtChild.getScreen().getDisplay();
- newtDisplay.setEDTUtil(new SWTEDTUtil(newtDisplay, getDisplay()));
+ // set SWT EDT and start it
+ {
+ final Display newtDisplay = newtChild.getScreen().getDisplay();
+ final EDTUtil edt = new SWTEDTUtil(newtDisplay, getDisplay());
+ newtDisplay.setEDTUtil(edt);
+ edt.invoke(true, new Runnable() { public void run() { } } ); // start EDT
+ }
newtChild.setSize(w, h);
newtChild.reparentWindow(nativeWindow);