summaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-03-05 19:20:19 +0100
committerSven Gothel <[email protected]>2020-03-05 19:20:19 +0100
commit3e141416ea6c85c14dc622dae57f071d5fd0ff4f (patch)
treeb59b7b782cdf768ba28939c88159e02eafb98f5a /src/newt/classes/com/jogamp
parent36ca7245653b1a0897f2070b9acbe0f0898f5949 (diff)
Bug 1398: Expose NativeSurface implementation's RecursiveLock if utilized
This prepares proper release of the acquired NativeSurface lock to cure the missing CGLContext lock, see followup commit.
Diffstat (limited to 'src/newt/classes/com/jogamp')
-rw-r--r--src/newt/classes/com/jogamp/newt/javafx/NewtCanvasJFX.java6
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java5
-rw-r--r--src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java4
3 files changed, 15 insertions, 0 deletions
diff --git a/src/newt/classes/com/jogamp/newt/javafx/NewtCanvasJFX.java b/src/newt/classes/com/jogamp/newt/javafx/NewtCanvasJFX.java
index 73f181dcf..ae46e2922 100644
--- a/src/newt/classes/com/jogamp/newt/javafx/NewtCanvasJFX.java
+++ b/src/newt/classes/com/jogamp/newt/javafx/NewtCanvasJFX.java
@@ -29,6 +29,7 @@
package com.jogamp.newt.javafx;
import com.jogamp.common.util.PropertyAccess;
+import com.jogamp.common.util.locks.RecursiveLock;
import com.jogamp.nativewindow.AbstractGraphicsConfiguration;
import com.jogamp.nativewindow.AbstractGraphicsScreen;
import com.jogamp.nativewindow.Capabilities;
@@ -96,6 +97,7 @@ public class NewtCanvasJFX extends Canvas implements NativeWindowHolder, WindowC
private volatile boolean postSetPos = false; // pending pos
private final EventHandler<javafx.stage.WindowEvent> windowClosingListener = new EventHandler<javafx.stage.WindowEvent>() {
+ @Override
public final void handle(final javafx.stage.WindowEvent e) {
if( DEBUG ) {
System.err.println("NewtCanvasJFX.Event.DISPOSE, "+e+", closeOp "+closingMode);
@@ -108,6 +110,7 @@ public class NewtCanvasJFX extends Canvas implements NativeWindowHolder, WindowC
}
} };
private final EventHandler<javafx.stage.WindowEvent> windowShownListener = new EventHandler<javafx.stage.WindowEvent>() {
+ @Override
public final void handle(final javafx.stage.WindowEvent e) {
if( DEBUG ) {
System.err.println("NewtCanvasJFX.Event.SHOWN, "+e);
@@ -530,6 +533,9 @@ public class NewtCanvasJFX extends Canvas implements NativeWindowHolder, WindowC
}
@Override
+ public RecursiveLock getLock() { return null; }
+
+ @Override
public int lockSurface() throws NativeWindowException, RuntimeException {
return NativeSurface.LOCK_SUCCESS;
}
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index 1da287102..f6c7ad955 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -971,6 +971,11 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
//
@Override
+ public RecursiveLock getLock() {
+ return window.getLock();
+ }
+
+ @Override
public final int lockSurface() throws NativeWindowException, RuntimeException {
return window.lockSurface();
}
diff --git a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
index 8ce1eaf2c..63286f5de 100644
--- a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
+++ b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
@@ -28,6 +28,7 @@
package com.jogamp.newt.swt;
+import com.jogamp.common.util.locks.RecursiveLock;
import com.jogamp.nativewindow.AbstractGraphicsConfiguration;
import com.jogamp.nativewindow.AbstractGraphicsDevice;
import com.jogamp.nativewindow.AbstractGraphicsScreen;
@@ -645,6 +646,9 @@ public class NewtCanvasSWT extends Canvas implements NativeWindowHolder, WindowC
}
@Override
+ public RecursiveLock getLock() { return null; }
+
+ @Override
public int lockSurface() throws NativeWindowException, RuntimeException {
return NativeSurface.LOCK_SUCCESS;
}