From f21f4d8e0f125f6c054b9f07e707fdf900fe4b35 Mon Sep 17 00:00:00 2001 From: Maik Riechert Date: Wed, 12 Jun 2013 22:57:54 +0200 Subject: Support specifying the X11 default display with a system property Usually, the environment variable DISPLAY is used to define the default display under X11. There are cases where the default display has to be defined or overridden programmatically. For those cases, the new system property nativewindow.x11.display.default can be used (as environment variables can't be changed in Java). Its semantics are identical to the DISPLAY environment variable. --- src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nativewindow/classes') diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java index e28aff116..2d9c42e09 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java +++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java @@ -46,6 +46,7 @@ import jogamp.nativewindow.NWJNILibLoader; import jogamp.nativewindow.ToolkitProperties; import com.jogamp.common.util.LongObjectHashMap; +import com.jogamp.common.util.PropertyAccess; import com.jogamp.nativewindow.x11.X11GraphicsDevice; /** @@ -123,7 +124,7 @@ public class X11Util implements ToolkitProperties { final boolean isInitOK = initialize0( XERROR_STACKDUMP ); final boolean hasX11_EXTENSION_ATIFGLRXDRI, hasX11_EXTENSION_ATIFGLEXTENSION; - final long dpy = X11Lib.XOpenDisplay(null); + final long dpy = X11Lib.XOpenDisplay(PropertyAccess.getProperty("nativewindow.x11.display.default", true)); if(0 != dpy) { if(XSYNC_ENABLED) { X11Lib.XSynchronize(dpy, true); -- cgit v1.2.3