diff options
-rw-r--r-- | make/scripts/tests.sh | 2 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/javafx/NewtCanvasJFX.java | 18 |
2 files changed, 15 insertions, 5 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index ffaaa7554..b670e40b1 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -126,6 +126,7 @@ function jrun() { #D_ARGS="-Dnativewindow.debug.X11Util.ATI_HAS_NO_XCLOSEDISPLAY_BUG" #D_ARGS="-Dnativewindow.debug.X11Util.ATI_HAS_NO_MULTITHREADING_BUG" + #D_ARGS="-Dnativewindow.debug.JFX -Dnewt.debug.Window -Djogamp.newt.javafx.UseJFXEDT=false" D_ARGS="-Dnativewindow.debug.JFX -Dnewt.debug.Window" #D_ARGS="-Djogl.disable.opengldesktop" #D_ARGS="-Djogl.disable.opengles" @@ -846,6 +847,7 @@ function testawtswt() { # #testjfx com.jogamp.opengl.test.junit.jogl.javafx.JFXStageGLChild01 $* testjfx com.jogamp.opengl.test.junit.jogl.javafx.TestNewtCanvasJFXGLn $* +#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT $* # # Misc Utils diff --git a/src/newt/classes/com/jogamp/newt/javafx/NewtCanvasJFX.java b/src/newt/classes/com/jogamp/newt/javafx/NewtCanvasJFX.java index 7efde273a..e04ed326d 100644 --- a/src/newt/classes/com/jogamp/newt/javafx/NewtCanvasJFX.java +++ b/src/newt/classes/com/jogamp/newt/javafx/NewtCanvasJFX.java @@ -28,6 +28,7 @@ package com.jogamp.newt.javafx; +import com.jogamp.common.util.PropertyAccess; import com.jogamp.nativewindow.AbstractGraphicsConfiguration; import com.jogamp.nativewindow.AbstractGraphicsScreen; import com.jogamp.nativewindow.Capabilities; @@ -80,6 +81,7 @@ import com.jogamp.newt.util.EDTUtil; */ public class NewtCanvasJFX extends Canvas implements NativeWindowHolder, WindowClosingProtocol { private static final boolean DEBUG = Debug.debug("Window"); + private static final boolean USE_JFX_EDT = PropertyAccess.getBooleanProperty("jogamp.newt.javafx.UseJFXEDT", true, true); private volatile javafx.stage.Window parentWindow = null; private volatile AbstractGraphicsScreen screen = null; @@ -414,12 +416,18 @@ public class NewtCanvasJFX extends Canvas implements NativeWindowHolder, WindowC final int w = clientArea.getWidth(); final int h = clientArea.getHeight(); - // set JFX EDT and start it - if(false) { + if(USE_JFX_EDT) { + // setup JFX EDT and start it final Display newtDisplay = newtChild.getScreen().getDisplay(); - final EDTUtil edtUtil = new JFXEDTUtil(newtDisplay); - edtUtil.start(); - newtDisplay.setEDTUtil( edtUtil ); + final EDTUtil oldEDTUtil = newtDisplay.getEDTUtil(); + if( ! ( oldEDTUtil instanceof JFXEDTUtil ) ) { + final EDTUtil newEDTUtil = new JFXEDTUtil(newtDisplay); + if(DEBUG) { + System.err.println("NewtCanvasJFX.reparentWindow.1: replacing EDTUtil "+oldEDTUtil+" -> "+newEDTUtil); + } + newEDTUtil.start(); + newtDisplay.setEDTUtil( newEDTUtil ); + } } newtChild.setSize(w, h); |