wmIsRunning bit in the server

Adam Jackson ajax at nwnk.net
Mon Aug 25 14:08:57 PDT 2008


On Mon, 2008-08-25 at 16:45 -0400, Owen Taylor wrote:

> > > However, making anything in the server depend on "xinitrc is finished"
> > > or "window manager is running" is clearly wrong.
> > 
> > Well, this is for a special situation that's really OS-X specific.   
> > The server is triggered to start when an X11 client connects to the  
> > $DISPLAY socket.  This triggers startx to run and start the server  
> > which accepts the initial connection from this socket.  We want to  
> > only accept that connection after the wm is running (yes, it's a  
> > kludge) because we want xinitrc to process ~/.Xresources... otherwise  
> > the user's xterm isn't as pretty as they want it.
> 
> Hmm, that's almost convincing :-) As a random idea, what if you simply
> didn't actually map toplevel windows unless they were either
> override-redirect or marked with a special property set by the window
> manager? (I assume that you have to use a patched/custom window manager
> anyways)

Actually, you don't.  That quartz-wm is closed-source is sort of
historical accident more than anything else, but twm works too.  You
don't get the pretty minimization-to-dock animation, but oh well.

My question would be how you'd know the window manager is the thing
trying to connect, since xinitrc potentially runs lots of other things.
I suppose the answer is that you don't care so much about that, just
about deferring the initial connection until after wm launch, and _that_
you can know because you can get the peer creds from launchd or
whatever.

There's already an internal callback chain for setting selection
ownership.  See the CallSelectionCallback at the bottom of
ProcSetSelectionOwner, and xfixes/select.c for an example of how to hook
into it.

- ajax




More information about the xorg mailing list