summaryrefslogtreecommitdiffstats
path: root/src/newt/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-11-26 18:33:20 +0100
committerSven Gothel <[email protected]>2011-11-26 18:33:20 +0100
commit78121938f8b432617bbb9f8e3e259ff1ffa9442e (patch)
treee4207c4eadde332f85e9b9e43e4c7cfeb2aa3338 /src/newt/classes
parente3c6a30ade94862a344c86dc0b733716c6fa27f5 (diff)
Revert some changes: X11Screen/RANDR, X11Util (XInitThreads/XLockDisplay), NEWT XDisplay Locking
Revert X11Screen RANDR commit 8cecd0c2963d982aa119cbb07698e56b9c271188, ie. use default 'render' display connection, best results on Ubuntu, Solaris, CentOS (no failures). Revert X11Util (XInitThreads/XLockDisplay) rational logic, commit 0314be79a7a93931a74fe4322bc78e699d7741e9, X11Util.HAS_XLOCKDISPLAY_BUG:=true and X11Util.XINITTHREADS_ALWAYS_ENABLED:=true. Which enables always utilizing XInitThreads() either before or after AWT initialization, as well as disable all XLockDisplay/XUnlockDisplay locks. Rever NEWT XDisplay X11 basic Locking commit 50100b85ce5fde48788efbc2211b26fb9d7c9dfd, ie use null locking if X11Util.HAS_XLOCKDISPLAY_BUG and X11Util.XINITTHREADS_ALWAYS_ENABLED.
Diffstat (limited to 'src/newt/classes')
-rw-r--r--src/newt/classes/jogamp/newt/driver/x11/X11Display.java20
-rw-r--r--src/newt/classes/jogamp/newt/driver/x11/X11Screen.java4
2 files changed, 18 insertions, 6 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/x11/X11Display.java b/src/newt/classes/jogamp/newt/driver/x11/X11Display.java
index 227dd7439..b3bc6e475 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/X11Display.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/X11Display.java
@@ -36,6 +36,7 @@ package jogamp.newt.driver.x11;
import javax.media.nativewindow.AbstractGraphicsDevice;
import javax.media.nativewindow.NativeWindowException;
+import javax.media.nativewindow.NativeWindowFactory;
import javax.media.nativewindow.x11.X11GraphicsDevice;
import jogamp.nativewindow.x11.X11Util;
@@ -70,11 +71,18 @@ public class X11Display extends DisplayImpl {
/**
* {@inheritDoc}
- *
+ *
* We use a private non-shared X11 Display instance for EDT window operations and one for exposed animation, eg. OpenGL.
- * Since it is possible to share this device via {@link com.jogamp.newt.NewtFactory#createDisplay(String, boolean)},
- * we have to supply it w/ basic locking, implicit to the constructor {@link X11GraphicsDevice#X11GraphicsDevice(long, int, boolean)}.
+ * <p>
+ * In case {@link X11Util#HAS_XLOCKDISPLAY_BUG} and {@link X11Util#XINITTHREADS_ALWAYS_ENABLED},
+ * we use null locking. Even though this seems not to be rational, it gives most stable results on all platforms.
+ * </p>
+ * <p>
+ * Otherwise we use basic locking via the constructor {@link X11GraphicsDevice#X11GraphicsDevice(long, int, boolean)},
+ * since it is possible to share this device via {@link com.jogamp.newt.NewtFactory#createDisplay(String, boolean)}.
+ * </p>
*/
+ @SuppressWarnings("unused")
protected void createNativeImpl() {
long handle = X11Util.openDisplay(name);
if( 0 == handle ) {
@@ -97,7 +105,11 @@ public class X11Display extends DisplayImpl {
}
// see API doc above!
- aDevice = new X11GraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT, false);
+ if(X11Util.XINITTHREADS_ALWAYS_ENABLED && X11Util.HAS_XLOCKDISPLAY_BUG) {
+ aDevice = new X11GraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT, NativeWindowFactory.getNullToolkitLock(), false);
+ } else {
+ aDevice = new X11GraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT, false);
+ }
}
protected void closeNativeImpl() {
diff --git a/src/newt/classes/jogamp/newt/driver/x11/X11Screen.java b/src/newt/classes/jogamp/newt/driver/x11/X11Screen.java
index aec24e316..d4eac9b07 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/X11Screen.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/X11Screen.java
@@ -258,8 +258,8 @@ public class X11Screen extends ScreenImpl {
// Internals only
//
private final <T> T runWithLockedDisplayHandle(DisplayRunnable<T> action) {
- // return display.runWithLockedDisplayHandle(action);
- return runWithTempDisplayHandle(action);
+ return display.runWithLockedDisplayHandle(action);
+ // return runWithTempDisplayHandle(action);
// return runWithoutLock(action);
}