• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Xterm not reading dotfiles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xterm not reading dotfiles


  • Subject: Re: Xterm not reading dotfiles
  • From: Ben Byer <email@hidden>
  • Date: Fri, 16 Nov 2007 19:14:56 -0800

On Nov 16, 2007 11:52 AM, Jeremy Huddleston <email@hidden> wrote:
I am hearing this alot, and I think I'm going to take a stab at
writing a new X11.app to combine/replace /u/X/X11.app and /A/U/X11.app
which takes into account many concerns I've been hearing.  Please feel
free to add your comments to http://www.x.org/XDarwin_TODO

Yeah, that *would* be great, and really the only way to solve <rdar://problem/5235232> Launching X11.app from dock results in two X11 dock entries  (number 3 on the list at http://www.x.org/wiki/XDarwin_TODO).

But, just so you know how we ended up with this ugly solution:
The main constraint is that in order for the launch support to work, launchd must be the process that invokes X11 / Xquartz / whatever. That is the only way it can make this call (in Xtrans.c):
  if (LAUNCH_DATA_ERRNO == launch_data_get_type(checkin_response)) {
       fprintf(stderr,"Check-in failed: %s\n",strerror(launch_data_get_errno(checkin_response)));
	   goto not_launchd;
	} 
(That is where the "Check-in failed: Permission denied" error comes from.)

The next logical solution was to add a "--launched_by_launchd" option, and then modify the launchd plist to pass that on the command line when X11 is invoked by launchd.  Then, if X11 was run *without* that option, it could just poke launchd (either by opening the socket, or explicitly using launchctl to start up X11, etc), then exit.  Launchd would then launch X11, and everything would be happy.  

When I tried that, instead of getting two X11.app icons in my dock, I got none.  Why?  My best guess is that there's a race there.

Here is the idealized, intended order of events:

1. I double-click /Applications/Utilities/X11.app in Finder
2. Finder tells LaunchServices to execute X11.app
3. LaunchServices tells the Dock to display the X11.app icon
4. X11.app tells launchd to run /Applications/Utilities/X11.app --launched_by_launchd
5. The first X11.app exits.
6. The Dock notices that X11.app has died, and removes the Dock icon.
7. Launchd starts /Applications/Utilities/X11.app --launched_by_launchd
8. LaunchServices tells the Dock to display the X11.app icon
9. ?
10. Profit!

Even this is suboptimal, because you can see the icon disappear in 6 and run again in 8, but such is life.

Instead, what seems to happen is this:
1. I double-click /Applications/Utilities/X11.app in Finder
2. Finder tells LaunchServices to execute X11.app
3. LaunchServices tells the Dock to display the X11.app icon
4. X11.app tells launchd to run /Applications/Utilities/X11.app --launched_by_launchd
7. Launchd starts /Applications/Utilities/X11.app --launched_by_launchd
8. LaunchServices tells the Dock to display the X11.app icon
5. The first X11.app exits.
6. The Dock notices that X11.app has died, and removes the Dock icon.

The dock can tell that the notifications for both #3 and #8 are for the same file, so it suppresses the duplicate notification, and then after #6, we're left with no icon.

I was not aware of the fact that Tiger's Xquartz could display an icon in the Dock without being run by X11.app (for use with XDMCP) -- I'm still not quite sure how it did that, but that might be the best option.  launchd could then directly run Xquartz.  
--
Ben Byer
CoreOS / BSD Technology Group, XDarwin maintainer

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list      (email@hidden)

This email sent to email@hidden

References: 
 >Xterm not reading dotfiles (From: Francisco De La Cruz <email@hidden>)
 >Re: Xterm not reading dotfiles (From: Jeremy Huddleston <email@hidden>)
 >Re: Xterm not reading dotfiles (From: Francisco De La Cruz <email@hidden>)
 >Re: Xterm not reading dotfiles (From: Jeremy Huddleston <email@hidden>)
 >Re: Xterm not reading dotfiles (From: Francisco De La Cruz <email@hidden>)
 >Re: Xterm not reading dotfiles (From: Jeremy Huddleston <email@hidden>)
 >Re: Xterm not reading dotfiles (From: Francisco De La Cruz <email@hidden>)
 >Re: Xterm not reading dotfiles (From: Jeremy Huddleston <email@hidden>)
 >Re: Xterm not reading dotfiles (From: Merton Campbell Crockett <email@hidden>)
 >Re: Xterm not reading dotfiles (From: Jeremy Huddleston <email@hidden>)
 >Re: Xterm not reading dotfiles (From: Nathan <email@hidden>)

  • Prev by Date: Re: Xquartz random crashes today, version 1.2a8, crash log included (now using 1.2a11)
  • Next by Date: An icon for each app, was Re: Where art thou, xinit?
  • Previous by thread: Re: Xterm not reading dotfiles
  • Next by thread: Re: Xterm not reading dotfiles
  • Index(es):
    • Date
    • Thread