The meaning(s) of $DISPLAY (was Re: Explanation of X implementations)
The meaning(s) of $DISPLAY (was Re: Explanation of X implementations)
- Subject: The meaning(s) of $DISPLAY (was Re: Explanation of X implementations)
- From: Eric Gouriou <email@hidden>
- Date: Fri, 16 Nov 2007 22:18:59 -0800
On Nov 16, 2007, at 8:50 PM, Ambrose Li wrote:
On 16/11/2007, Ben Byer <email@hidden> wrote:
First, when I launch the regular terminal, it runs X now as well.
Just to tackle this -- this probably means you have something in your
.bash_profile (or other appropriate startup configuration file)
that deals
with X or X configuration -- xmodmap, perhaps? As soon as you run
anything
that connects to $DISPLAY, X11.app will start.
This reminds me of something. Before launchd support, the standard
way to check whether a script is running in X (that is, whether X is
*already* up) is to check whether $DISPLAY is defined. Now that
assumption is wrong. This means that launchd support has broken
backward compatibility in a very fundamental level.
$DISPLAY being set means that X is _available_, not that the user
desires
to get X clients started or that contacting the X server is a 0-cost
operation.
Indeed it can already be pretty expensive to contact an already running
server, for example when operating over long latency connections.
Thanks to launchd, X is always running on Leopard. It's just very,
very good at
consuming no resources as long as it has no clients. That's similar to
traditional
network services started via xinetd, "the ssh server" is available as
soon as it
is configured, whether an instance of the sshd executable is currently
running or not.
(I would bet that this is why .bash_profile or .bashrc is running X
programs—because $DISPLAY is set so it assumes that it *should*
run those X programs.)
I always had DISPLAY set on Tiger, whether I had started X or not,
because
I did not want to type "DISPLAY=:0.0 <command>" if I wanted to start
an X client
from a Terminal (or iTerm then) window. Somehow it never caused me much
harm, even though I used to connect to very remote systems in this way
(>500ms
ping times).
As you mentioned above, the launchd supports does break some
assumptions,
but those assumptions were never quite valid to start with. The fact
that X is available
(running or launched-on-demand) doesn't mean that I want every app
that can be
an X client to start as one. Those init files or executables need
tweaking.
One may call this breaking backward compatibility, one could call
this a necessary
rethink of old practices. It's only a few years from now that we'll be
able to tell.
Disclaimer: I do work for Apple but those are my opinions only, not
those of the company.
I don't work in Ben's or Jordan's teams and had no input whatsoever in
those changes.
I like them as they match what I was hoping for when I used Tiger and
X every
day at my previous job in a different company. I don't use X quite as
much nowadays
but still follow its evolution with great interest.
Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden