summaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes
diff options
context:
space:
mode:
Diffstat (limited to 'src/nativewindow/classes')
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java8
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java18
2 files changed, 5 insertions, 21 deletions
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java
index 40d212df3..10e3f7857 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java
@@ -65,13 +65,7 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
* @see DefaultGraphicsDevice#DefaultGraphicsDevice(String, String, int, long)
*/
public X11GraphicsDevice(long display, int unitID, boolean owner) {
- // FIXME: derive unitID from connection could be buggy, one DISPLAY for all screens for example..
- super(NativeWindowFactory.TYPE_X11, X11Lib.XDisplayString(display), unitID, display);
- if(0==display) {
- throw new NativeWindowException("null display");
- }
- handleOwner = owner;
- isXineramaEnabled = X11Util.XineramaIsEnabled(this);
+ this(display, unitID, NativeWindowFactory.getDefaultToolkitLock(NativeWindowFactory.TYPE_X11, display), owner);
}
/**
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
index d74954a0d..f916a8ef3 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
@@ -50,12 +50,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
* @param type
*/
public DefaultGraphicsDevice(String type, String connection, int unitID) {
- this.type = type;
- this.connection = connection;
- this.unitID = unitID;
- this.uniqueID = getUniqueID(type, connection, unitID);
- this.handle = 0;
- this.toolkitLock = NativeWindowFactory.getDefaultToolkitLock(type);
+ this(type, connection, unitID, 0, NativeWindowFactory.getDefaultToolkitLock(type));
}
/**
@@ -65,19 +60,14 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
* @param handle
*/
public DefaultGraphicsDevice(String type, String connection, int unitID, long handle) {
- this.type = type;
- this.connection = connection;
- this.unitID = unitID;
- this.uniqueID = getUniqueID(type, connection, unitID);
- this.handle = handle;
- this.toolkitLock = NativeWindowFactory.getDefaultToolkitLock(type, handle);
+ this(type, connection, unitID, handle, NativeWindowFactory.getDefaultToolkitLock(type, handle));
}
/**
- * Create an instance with the given {@link ToolkitLock} instance.
+ * Create an instance with the given {@link ToolkitLock} instance, or <i>null</i> {@link ToolkitLock} if null.
* @param type
* @param handle
- * @param locker
+ * @param locker if null, a non blocking <i>null</i> lock is used.
*/
public DefaultGraphicsDevice(String type, String connection, int unitID, long handle, ToolkitLock locker) {
this.type = type;