#154 XOpenDisplay(NULL) doesn't return window

Other
closed-works-for-me
nobody
X server (105)
5
2002-02-12
2002-01-15
Anonymous
No

Hi!

If this is covered in some README, try not to flame me
too much! Just please point me in the right direction...

Recently I've been compiling/porting X-window based
scientific software to Mac OSX.

I downloaded and compiled the laterst and greatest
XFREE86 via CVS. XWindows, xterm, the xclock all come
up nicely.

However, it seems that the statement

display = XOpenDisplay(NULL)

does not return a server handle when X is running,
whereas specifying the value of the $DISPLAY
environment variable in the source code brought up the
window just fine.

display = XOpenDisplay(":0.0")

(my $DISPLAY is ":0.0" - I assume this is the default
server handle)

The software comiled and ran fine after this change,
but this seems non-standard based on a number of
X-Window books I have consulted. Any ideas?

Any help would be appreciated.

Thanks much!

Bill Seng
bill@seng.org

Discussion

  • Greg Parker
    Greg Parker
    2002-01-16

    Logged In: YES
    user_id=37183

    XOpenDisplay(NULL) works for me. Are you sure DISPLAY is set correctly in that program's environment? You can use getenv() to check what the program thinks DISPLAY is.

     
  • Logged In: YES
    user_id=133579

    A possible source of confusion is that DISPLAY will be set correctly in xterms by xinit, but it will not be set in Terminal windows unless you take special care to set it yourself.

     
    • status: open --> closed-works-for-me