If I have an application open in X11.app on Mac OS 10.6 and I switch away to another app and then back with Command-Tab, none of the X application come to the foreground.
How can I make this happen?
tell application "X11" to activate
Good enough.
Command-Tab to try to bring X11 to front. While it is in "front" (but not really), Command-Tab-Shift-Tab, and it will come to front.
In more detail, when it should be in front, Command-Tab as though you will bring something else to front, but before you let go and activate something else, select X11 again. You can do this by cycling all the way through the open apps, or hitting Shift-Tab while holding down the Command key.