aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2019-03-21 00:58:39 +0100
committerSven Gothel <[email protected]>2019-03-21 00:58:39 +0100
commit8a66defd3c2c96b05c8868d5edb604e3564ff66d (patch)
tree69facc3e7dbdaa5164c698976cb4eb171fefd0d6
parent5ae0eeca1a7031931d10c0db56539bf565ee9591 (diff)
NewtCanvasJFX: Utilize JFXEDTUtil per default, supporting the Windows Platformjavafx
On [GNU/Linux] X11 JFXEDTUtil is not required, since X11 can handle multi-threaded native parenting, however, the Windows platform does require JFXEDTUtil. Currently the default is to use JFXEDTUtil, which operates solely on the JavaFX thread for windowing lifecycle and even-dispatch operations. This behavior can be toggled via the boolean property 'jogamp.newt.javafx.UseJFXEDT', which currently defaults to 'true' This behavior might be analyzed in more detail for a fine grained EDTUtil decision.
-rw-r--r--make/scripts/tests.sh2
-rw-r--r--src/newt/classes/com/jogamp/newt/javafx/NewtCanvasJFX.java18
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);