summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/newt/classes/jogamp/newt/driver/x11/X11Screen.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/x11/X11Screen.java b/src/newt/classes/jogamp/newt/driver/x11/X11Screen.java
index adc44f837..0b46e39cb 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/X11Screen.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/X11Screen.java
@@ -33,6 +33,7 @@
*/
package jogamp.newt.driver.x11;
+// import jogamp.nativewindow.x11.X11Util;
import jogamp.newt.DisplayImpl;
import jogamp.newt.ScreenImpl;
import jogamp.newt.DisplayImpl.DisplayRunnable;
@@ -258,22 +259,26 @@ public class X11Screen extends ScreenImpl {
//
private final <T> T runWithLockedDisplayHandle(DisplayRunnable<T> action) {
return display.runWithLockedDisplayHandle(action);
- // return runWithTempDisplayHandle(action);
+ // return runWithLockedTempDisplayHandle(action);
+ // return runWithoutLock(action);
}
- /** just here for testing some X11 RANDR bugs .. etc ..
- private final Object runWithTempDisplayHandle(DisplayRunnable action) {
- long dpy = X11Util.openDisplay(null);
- if(0 == dpy) {
+ /** just here to debug X11 RANDR / GL locking issues
+ private final <T> T runWithLockedTempDisplayHandle(DisplayRunnable<T> action) {
+ final long displayHandle = X11Util.openDisplay(display.getName());
+ if(0 == displayHandle) {
throw new RuntimeException("null device");
}
- Object res;
+ T res;
try {
- res = action.run(dpy);
+ res = action.run(displayHandle);
} finally {
- X11Util.closeDisplay(dpy);
+ X11Util.closeDisplay(displayHandle);
}
return res;
+ }
+ private final <T> T runWithoutLock(DisplayRunnable<T> action) {
+ return action.run(display.getHandle());
} */
private static native long GetScreen0(long dpy, int scrn_idx);