diff options
author | Sven Gothel <sgothel@jausoft.com> | 2011-11-26 08:23:46 +0100 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2011-11-26 08:23:46 +0100 |
commit | 6c1aa039afc4b81eeacdc97993cd7c7b2efc6ea4 (patch) | |
tree | aeebee9091bc9511246ab79ca36b54944d9c2059 /src/newt/classes/jogamp | |
parent | 41d34e1c4594bd1f552dace2b3e1b69889a138fd (diff) |
NEWT X11Screen: Update X11 RANDR / GL locking test code (still commented out)
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r-- | src/newt/classes/jogamp/newt/driver/x11/X11Screen.java | 21 |
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); |