Starting X server from another program
Starting X server from another program
- Subject: Starting X server from another program
- From: Dave Williss <email@hidden>
- Date: Wed, 18 Jul 2007 09:04:13 -0500
I'm trying to find a way to have an X11 application start X11.app if
it's not already running.
For the most part, something like this works pretty well...
* look for the socket file that X11 creates in /tmp. If not there,
skip the next step
* call XOpenDisplay. If that works, X11 is running - nothing to do.
* find /Applications/Utilities/X11.app/Contents/MacOS/X11
* call execp() or system() to start it.
* call XOpenDisplay again
This has been working fine in most versions on Mac OS. However,
launching X11 this way isn't working with the version of X11 from the
latest beta OS. The X11 icon never shows up as having started in the
task bar and the server never starts, but X11.app obviously did
*something* because the console log reports that an xterm was unable to
connect to the X server.
This is only a problem if I launch it via calls to execp() or system().
If I launch it from a command shell it works just fine.
I don't know for sure if it's the X11.app that's causing the problem or
the OS itself. Maybe by using system() I'm bypassing some vital thing.
I'm wondering if there's a more accepted way under OS X to have one
program launch another.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden