Login  Register

Re: Using a display connection name fails (through NewtFactory)

Posted by Sven Gothel on Jun 12, 2013; 2:21pm
URL: https://forum.jogamp.org/Using-a-display-connection-name-fails-through-NewtFactory-tp4029333p4029380.html

On 06/12/2013 04:14 PM, neothemachine [via jogamp] wrote:

> Found it, it's in X11Util.initSingleton() the following line where
> 'null' means get the default:
>
> 'final long dpy = X11Lib.XOpenDisplay(null);'
>
> Actually, I just tried the environment variables hack
> (http://stackoverflow.com/a/7201825/60982) but it didn't work and I
> guess it's because X11Lib.XOpenDisplay is a native method which has an
> own copy of the environment.
>
> So, to have a more proper solution, would you accept a patch like the
> following for the X11Util.initSingleton() method?
>
> instead of:
> 'final long dpy = X11Lib.XOpenDisplay(null);'
>
> this:
>
> final long dpy = X11Lib.XOpenDisplay(System.getProperty("DISPLAY"));
>
> If the property is not set (the default case), then getProperty()
> returns null and thus the old behavior is used.
if that works well w/ you - KUDOS, it's a small and smart change.

pls verify and send a git pull request.

~Sven



signature.asc (911 bytes) Download Attachment