From 6c1aa039afc4b81eeacdc97993cd7c7b2efc6ea4 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 26 Nov 2011 08:23:46 +0100 Subject: NEWT X11Screen: Update X11 RANDR / GL locking test code (still commented out) --- .../classes/jogamp/newt/driver/x11/X11Screen.java | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/newt/classes') 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 runWithLockedDisplayHandle(DisplayRunnable 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 runWithLockedTempDisplayHandle(DisplayRunnable 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 runWithoutLock(DisplayRunnable action) { + return action.run(display.getHandle()); } */ private static native long GetScreen0(long dpy, int scrn_idx); -- cgit v1.2.3