[Xquartz-dev] XQuartz 2.6.0 (xorg-server 1.9.2.901) and X authority

Jeremy Huddleston jeremyhu at apple.com
Sun Dec 26 17:13:33 PST 2010


On Dec 26, 2010, at 08:26, Peter Dyballa wrote:

> 
> Am 25.12.2010 um 21:19 schrieb Jeremy Huddleston:
> 
>>> I think I started to set DISPLAY because Terminal's shell has no knowledge of it. So I can't launch an X client off it. In the beginning I used
>>> 
>>> 	if (! $?DISPLAY) then ...
>>> 
>>> as usual. With Tiger some change came so that DISPLAY was then set initially via ~/.MacOSX/environment.plist
>> 
>> I do not believe Apple has ever released software that has set DISPLAY in ~/.MacOSX/environment.plist.  On Tiger, DISPLAY is simply not set except in child processes of X11.app (hence why we solved that by using launchd in Leopard).
> 
> This was the unsatisfactory default situation. So I developed this scheme, taking into account a multi-user environment.

Ok, so that was your solution on Tiger.  Our solution was to use a LaunchAgent on Leopard (which also works in a multi-user environment).  I suggest you ditch your hack and try using the LaunchAgent which does what you want out of the box.

>>> This stopped working at some time. Of course when I want to launch an X client I don't want to switch to Finder, make it open a new window I would have to close later,
>> 
>> You don't have to... why do you think you would?
> 
> Because clicking is the Apple way?

Really?  Well you can do it however you want.


>>> then find my way through the file system hierarchy to the directory with the X clients and then search among them some time for the one I want to launch.
>> 
>> I have no idea how you got here in your thought process.
> 
> How would I else be able to double-click on the X client I wish to launch?

If you really want to create app bundles to double click to launch X11 applications, we can go into how to do that, but that's not really the supported method.  The supported method for launching X11 applications is from X11.app's Application menu or from a terminal.

>>> And I also don't want to search in the Finder window for my favourite X clients place
>> 
>> I hardly ever use Finder.  How did Finder come up?
> 
> Because it seems to be the standard tool to find the file for double-clicking.

Ok, but we're talking about X11 applications here, which are not usually in bundles.  They're usually in $PATH and launched from the command line.

>>> Why is the DISPLAY variable not communicated among all processes running at the moment and launched afterwards, after DISPLAY's first setting or its possible change?
>> 
>> It is by default.  You are overwriting it in .login.
> 
> I think I had noticed that this initial setting did not happen... But I'll try again on next login, hopefully next year.

Well, if it isn't set, then you should look into that.  Perhaps you have something lingering that you forgot.  There is a FAQ entry to help find it.

> I made some tests. I made sure that no *sh RC file sets DISPLAY. I also removed DISPLAY from the environment of Terminal. With ps I could see that some processes had set DISPLAY=:0, but most had DISPLAY=/tmp/launch-OtsB9G/org.x:0. This value is also set in a new Terminal window.

Right.

> When I launch for example FontForge from the first Terminal window (no DISPLAY set)

Why is DISPLAY not set?  I thought you said it was set to DISPLAY=/tmp/launch-OtsB9G/org.x:0 ... ?

> or when I launch X11 by double clicking on the X11 icon in Dock I can see with pstree that launchd is the process which initiates the X11 session, like here:
> 
> 	-+= 00001 root /sbin/launchd
> 	 \-+- 74710 pete /bin/sh /opt/local/bin/startx
> 	   \-+- 74746 pete xinit /opt/local/lib/X11/xinit/xinitrc -- /opt/local/bin/X :0 -dpi 96 -auth /Users/pete/.serverauth.74710
> 	     \-+= 74824 pete /opt/local/bin/quartz-wm
> 	       \-+- 74881 pete /usr/local/bin/emacs-23.2 -geometry 96x56+25+125 -T 23.2 --debug-init
> 	         \-+= 74909 pete -bin/tcsh -i
> 	           \-+= 75137 pete pstree -w -p 74909
> 	             \--- 75138 root ps -axwwo user

Right.

> Starting with quarz-wm (blackbox keeps crashing with xorg-server 1.9.2.901, 1.9.3, and some more) DISPLAY has become :0. This is also reported by env in GNU Emacs *shell* buffer.

blackbox will exit with a failure because it notices you already have a WM (quartz-wm).  If you want to use blackbox instead, see the portion of my email that you deleted when forming your reply:

"""
If you want a different WM, do:

mkdir ~/.xinitrc.d
echo "exec /path/to/blackboxwm" > ~/.xinitrc.d/99-wm.sh
chmod 755 ~/.xinitrc.d/99-wm.sh
"""

> How can I launch X clients without launchd?

That's in the FAQ, but I don't think that is what you actually want.  It sounds like what you want is to use blackbox which is orthogonal to launchd.  Keep launchd around, setup xinitrc.d to use blackbox, and launch your applications from Terminal.app, or just launch X11.app directly.

> From the first Terminal (no DISPLAY set) I cannot launch xrmap – no DISPLAY.

DISPLAY should be set.  If it's not, then you have something unsetting it.

> When I launch it from inside GNU Emacs it works. When I launch it from the second Terminal (with DISPLAY=/tmp/launch-OtsB9G/org.x:0) a second X server (XQuartz 2.5.3 (xorg-server 1.8.2)) launches.

If a second server is launching, you should investigate why the first one is not claiming the launchd socket.  How are you launching the first X11 server?

> It creates my usual X desktop (because I have ~/.xinitrc.d/50-clients.sh). In its GNU Emacs's *shell* buffer DISPLAY is set to :1.

That would be because it inherits from the xinitrc environment which has the traditional DISPLAY set.



More information about the Xquartz-dev mailing list