Flylib.com

Books Software

 
 
 

Chapter 5. The X Window System

Chapter 5. The X Window System

Although the X in "Mac OS X" is not the same X as in "The X Window System," you can get them to play nice together.

Most Unix systems use the X Window System as their default GUI. (We'll refer to the X Window System as X11 instead of X, to avoid confusion with Mac OS X.) X11 includes development tools and libraries for creating graphical applications for Unix-based systems. Mac OS X does not use X11 as its GUI, relying instead on Quartz (and, on compatible hardware, Quartz Extreme), a completely different graphics system. However, Apple's own implementation of X11 for Mac OS X, based on the open source XFree86 Project's X11 (http://www.xfree86.org/), was initially released as a beta for Jaguar and is now bundled with Mac OS X Panther as an optional installation. Apple also provides an X11 software development kit (the X11 SDK) on the Xcode Tools CD that ships with Panther.

This chapter highlights some of the key features of Apple's X11 distribution and explains how to install Apple's X11 and the X11 SDK. It also explains how to use X11 in both rootless and full-screen modes (using the GNOME and KDE desktops). You'll also learn how to connect to other X Window systems using Virtual Network Computer (VNC), as well as how to remotely control the Mac OS X Aqua desktop from other X11 systems.

From Aqua to X11, there's no shortage of graphical environments for Mac OS X. The operating system's solid Unix underpinnings and powerful graphics subsystem make it possible for developers to support alternative graphical environments. For this reason, a humble iBook can make a fine cockpit for a network of heterogeneous machines!

5.1 About Apple's X11

As noted earlier, Apple's X11 distribution is based on the open source XFree86 Project's XFree86, Version 4.3. The X11 package has been optimized for Mac OS X and has the following features:

  • X11R6.6 window server

  • Support for the RandR (Resize and Rotate) extension

  • Strong integration with Mac OS X environment

  • A Quartz window manager that provides Aqua window decorations, ability to minimize windows to the Dock, and pasteboard integration

  • Can use other window managers

  • Compatible with Expose

  • Supports rootless and full-screen modes

  • Customizable Application menu, which allows you to add applications for easy launching and to map keyboard shortcuts

  • Customizable Dock menu, which allows you to add applications for easy launching, to map keyboard shortcuts, and to list all open windows

  • Finder integration, which supports auto-detection of X11 binaries and double-clicking to launch X11 binaries, starting the X server if it is not already running

  • Preference settings for system color map, key equivalents, system alerts, keyboard mapping, and multi-button mouse emulation

  • Hardware acceleration support for OpenGL (GLX) and Direct CG (AIPI)

5.2 Installing X11

Apple's X11 for Mac OS X is available as an optional installation bundled with Mac OS X. To install it when you first install (or upgrade an existing installation of) Mac OS X Panther, you must customize the installation (in the Selection Type phase) and select the X11 checkbox. If you don't install X11 during the Mac OS X installation, you can install it later by inserting the Install Mac OS X Disc 3 CD, then finding and double-clicking the X11User.pkg package in the Packages folder.

The installation places the double-clickable X11 application in the /Applications/Utilities folder. If you're going to build X11-based applications, you'll need to install the X11SDK, which is located as an optional package on the Xcode Tools CD ( /Developer Tools/Packages/X11SDK.pkg ). Instructions for building X11 applications are included in Chapter 8; this chapter simply focuses on using X11.