A collection of Bits and Pieces that, as somebody wrote at the mailing lists...

...may, or may not, be useful to those encountering problems with X11 since upgrading to Mac OS X 10.5 (Leopard)...


...I also realize that this is a mailing list devoted to users of X11 and users by almost categorical definition are somewhat demanding.  That's fine.   We're all used to that and, as engineers of any stripe, are genuinely happy to see users using our stuff (without which there wouldn't be much point to it). I only hope that those developers also lurking on this list will get the not-at-all-subtle point I'm trying to make about how to really advance the cause of X11 on MacOSX or any other platform for that matter...


...The decision to move Apple's X11 to X.org was, and is, a sound one.

Because of the, dare I say, ancient, code and libraries in the older X11 it was becoming more and more difficult to build and run modern X11 applications on Mac OS X. This is why, for example, the Gimp.app people bundle some libraries in their application bundle, the shipping ones are too old to run newer gimp...


...It's an unfortunate coincidence that the same customizations that you, the X11 Power User, would have made on Tiger to get everything work automatically end up being the same things that cause Leopard breakage -- starting X11.app from the dock will get you two icons, and setting DISPLAY in your environment will throw away the location of the launchd socket that X clients need to know how to use....


...Put bluntly:
...Fullscreen mode won't happen if I'm the one that has to write the code...

...On the other hand, the people who are really into "this graphics stuff" would probably be able to get something working with a weekend of work. Those people are out there -- I know some of them are even reading this, right now, and they know who they are. This message is partially to them...


...though I can say that when you have thousands of bugs to go through, some inevitably wind up at the end of the queue or even fall temporarily between the cracks. Bugs are still tracked pretty aggressively, however, so even though delayed (and this would by no means by the record - I think some bugs filed in 2001 were fixed for Leopard), they're ultimately looked at and given some sort of love. Filing radars to /dev/null would certainly reduce our workload, but it's also not an option we're given in engineering. :-)...


...so far, with every new OSX version the handling of MANPATH has completely changed. path_helper now sets MANPATH, so unless you explicitly *unset* MANPATH in your shell startup scripts, the man.conf stuff is never used...

...What's up with the new TMPDIR stuff in Leopard...?
[sao @ Heaven: ~] % env | grep TMP TMPDIR=/var/folders/gT/gTP-yKBYEOi7+X7a0FnX+k+++TI/-Tmp-/ [sao @ Heaven: ~] % ls /var/folders gT zz

...the decisions which led to this (change) revolved around security. There were a number of attacks which used prior knowledge of another processes' temporary directory location to race it to the creation of temporary files. I think the benefits of "randomizing" it and putting it under the control of launchd far outweigh any legitimate uses of it (and processes which need to share files across user instances ought to create specialized subdirectories of /tmp for this purpose anyway)...


......I want X11 (or actually launchd) waiting around for me, so X11 can start when I want it to... which means when I launch an application that requires X. But applications are broken that automatically assume they can fool with my X server just because $DISPLAY is set. Software should never try to guess what the user's intentions are. If they aren't obvious, either ask, or take no action.

The beauty of launchd is that you no longer have to check for the server's existence. There's no distinction, because it will be there if you need it. When you start an application that legitimately requires X, it's obvious you want X running, so launchd will run it. If you have shell scripts that check for $DISPLAY to make decisions, I'll bet you can rethink the problem and you'll find a better solution.

The bottom line is this: unless a script or program REQUIRES X, it should never check to see if it is running in the presence of an X server, because it shouldn't be using X, unless the user explicitly says so. And whether the script or program was instructed to use X, or it simply requires X, the user will be expecting X to start, so it should do so automatically.

And if you disagree, you can always disable the launch agent....


...It would never have been ready if it was not released though. Ben would be fixing bugs in the older X11, and working on the other portions of his job. Jeremey, Nathan, Nathaniel and others would not be putting in so much effort into fixing the problems. We'd be stuck with the tiger X11 forever...

...While it is unfortunate that all the bugs were not entirely eliminated prior to 10.5 shipping (like that ever happens!), I have to applaud the decision to ship it...

...ever wondered what happens after you submit an X11 bug report...?

By way of "submit this bug" button in the crash dialog:
1. Crash log is filed in a database at Apple
2. When enough similar crash logs arrive, a bug report is automatically created
3. Bug report is sent to X11 group
4. Ben Byer reads bug report

By submitting a bug report at http://bugreport.apple.com :
1. Bug report is sent to Apple Developer Connection
2. ADC forwards bug to X11 group
3. Ben Byer reads bug report
...so, if you have a reproducible crash with instructions or code to make it occur, bugreport.apple.com is better than the "submit this bug" button. Be sure to specify which X11 version you're using, and any X11 configuration changes you've made...


...The receipts are now in /Library/Receipts/boms/, and there is a command "pkgutil" to manage them, including removing the receipt or even the installed files. The pkg's themselves are no longer directories, but /usr/bin/xar archives...


......Why not put a bunch of these one-line scripts in a folder, give them all the same names as the menus you used to have, and stick that folder in the Dock? Now they can just select if from a stack, and X11 will launch automatically.....


...about the syslog command...

...I have not yet understood what is the relation between the messages it shows and the contents of /var/log/system.log and the (real or virtual) console.log. What syslog shows is almost orthogonal to everything I can display with Console.app... OTOH, the X11.app startup messages that are shown by Console.app are not shown by syslog...

...Selected one-liners...

...Spaces severely needs a "Do not yank" option...

...who wrote Spaces must have been following a cooking recipe for flapjacks

...And, just to be clear here -- the Applications menu *should* work. It's a bug.

...It'd be nice, but 95% of the Mac userbase would wonder what a BSD was. :)

...Like I said, it works when it works, but it doesn't when it doesn't.

...you get to see the places I had to use duct tape to hold this all together.

...Just something to chew on, for those so inclined. :)

...Me? Sure? Never, especially not late at night. ;)

...in bug tracking systems, one man's feature is another man's bug.

...If only we GNU what the problem was...


....Oh, I swear, there are 5 unique conversations about X11 on the Mac that happen, total, and this is one of them - but at least now we can have it publicly and recorded for posterity :)
...I'll probably wake up screaming tonight after having nightmares about my Dock filled with 30 X11 related icons that serve no purpose...


...commands only...
To check if you have the launchd plist required to launch X11 in Leopard:
launchctl list | grep org.x

To load the .plist file:
sudo launchctl load -w /System/Library/LaunchAgents/org.x.X11.plist

Use pkgutil to see "missing" files:
pkgutil --verify com.apple.pkg.update.os.10.5.1

Is X running and you don't see it? Check by running:
ps aux | grep X

To get seven lines worth of Console messages:
syslog -C | tail -n 7

To supress xterm running by default:
defaults write org.x.X11_launcher app_to_run /usr/X11/bin/xlsclients

Versions and more versions...
pkg-config xorg-server --modversion X -version Xquartz -version

Let's talk X11 fonts commands...
fc-cache -v fc-list fc-cat fc-match mkfontdir mkfontscale xlsfonts xlsfonts | wc -l xfontsel xset q xset fp strings /usr/X11/lib/libfontconfig.dylib | grep -C 1 FONTCONFIG_PATH cat /usr/X11/lib/X11/fonts/OTF/fonts.dir

XDMCP - Xnest - Xephyr...
Xquartz -query Xnest -query 10.0.10.1 -geometry 1024x768 :1 Xephyr -ac -fullscreen :9 & Xephyr -fullscreen -query -once (mylinuxserverIP) :9 Xephyr -screen 1024x768 -query -once (mylinuxserverIP) :9

To generate a text file "installed-pkgs" that has a list of all of your installed packages with Fink:
fink list -i | grep -v " p " | cut -f 2 > installed-pkgs