Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Starting X server from another program



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)
Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/x11-users/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.