X Window System

This is an old revision of this page, as edited by David Gerard (talk | contribs) at 08:51, 2 September 2005 (realign images - they foul up on a wide screen in Classic). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In computing, the X Window System (commonly X11 or X) is a windowing system for bitmap displays. It is the standard toolkit and protocol to build graphical user interfaces on Unix, Unix-like operating systems and OpenVMS, and is available for almost all modern operating systems.

X Window System logo
X Window System logo

X provides the basic framework for a GUI environment: drawing and moving windows on the screen and interacting with a mouse and keyboard. X does not mandate the user interface — this is handled by individual programs. As such, the visual styling of X-based environments varies greatly; different programs may present radically different interfaces.

X features network transparency: the machine where application programs (the client applications) run need not be the user's local machine (the display server). X's usage of the terms "client" and "server" is the reverse of what people often expect, in that the "server" is the user's local display rather than the remote machine.

X originated at MIT in 1984. The current protocol version, X11, was released in September 1987. The project is led by the X.Org Foundation; the current reference implementation is version 11 release 6.8.2 and is free software under the MIT License and similar permissive licenses.

KDE 3.4
GNOME 2.10.0

The X client-server model and network transparency

Main article: X Window System protocols and architecture

X is based on a client-server model. An X server communicates with various client programs. The server accepts requests for graphical output (windows) and sends back user input (keyboard, mouse, touchscreen). The server may be an application displaying to a window of another display system, it may be a system program controlling the video output of a PC or it may be a dedicated piece of hardware.

This client-server terminology — your terminal is the "server", the remote applications are the "clients" — often confuses new X users, because the terms appear reversed. But X takes the perspective of the program, rather than the end-user or the hardware: the local X display provides display services to programs, so it is acting as a server; the remote program uses these services, thus it acts as a client.

 
In this example, the X server takes input from a keyboard and mouse and displays to a screen. A web browser and a terminal emulator run on the user's workstation, and a system updater runs on a remote server but is controlled from the user's machine. Note that the remote application runs just as it would locally.

The communication protocol between server and client operates network-transparently: the client and server may run on the same machine or on different ones, possibly with different architectures and operating systems, but they run the same in either case. A client and server can even communicate securely over the Internet by tunneling the connection over an encrypted connection.

To start a remote client program displaying to a local server, the user will typically open a terminal window and telnet or ssh to the remote machine, tell it to display to the user's machine (e.g. export DISPLAY=[user's machine]:0 on a remote machine running bash) then start the client. The client will then connect to the local server and the remote application will display to the local screen and be controlled by the local input devices. Alternately, the local machine may run a small helper program to connect to a remote machine and start the desired client application there.

Practical examples of remote clients include: administering a remote machine graphically; running a computationally intensive simulation on a remote Unix machine and displaying the results on a local Windows desktop machine; running graphical software on several machines at once, controlled by a single display, keyboard and mouse.

Design principles of X

In 1984, Bob Scheifler and Jim Gettys set out the early principles of X:

  • Do not add new functionality unless an implementor cannot complete a real application without it.
  • It is as important to decide what a system is not as to decide what it is. Do not serve all the world's needs; rather, make the system extensible so that additional needs can be met in an upwardly compatible fashion.
  • The only thing worse than generalizing from one example is generalizing from no examples at all.
  • If a problem is not completely understood, it is probably best to provide no solution at all.
  • If you can get 90 percent of the desired effect for 10 percent of the work, use the simpler solution. (See also Worse is better.)
  • Isolate complexity as much as possible.
  • Provide mechanism rather than policy. In particular, place user interface policy in the clients' hands.

The first principle was modified during the design of X11 to: "Do not add new functionality unless you know of some real application that will require it." X has largely kept to these principles since. The reference implementation is developed with a view to extension and improvement of the implementation, whilst remaining almost entirely compatible with the original 1987 protocol.

User interfaces

File:Solaris8-cde.png
CDE on UNIX (Solaris 8)
 
DECwindows CDE on OpenVMS 7.3-1

X deliberately contains no specification as to application user interface, such as buttons, menus, window title bars and so on. These are provided by user software, such as window managers, GUI widget toolkits and desktop environments, or application-specific GUIs, such as point of sale. As such, the "typical" X interface has varied tremendously over the years.

A window manager is used to control the placement and appearance of application windows. This may have an interface akin to that of Microsoft Windows or the Macintosh (e.g. Kwin in KDE or Metacity in GNOME) or have radically different controls (e.g. twm, the basic window manager supplied with X). The window manager may be bare-bones (e.g. twm) or offer functionality verging on that of a full desktop environment (e.g. Enlightenment).

Most users use X with a full desktop environment, which includes a window manager, various applications and a consistent interface. The most popular are GNOME and KDE. The Unix standard environment is the Common Desktop Environment (CDE). The freedesktop.org initiative addresses interoperability between desktops and the components needed for a competitive X desktop.

Implementations

The canonical implementation of X is the X.Org reference implementation. Due to the liberal licensing, a number of variations, both free and proprietary, have appeared. Commercial UNIX vendors have tended to take the reference implementation and adapt it for their hardware, usually customising it heavily and adding proprietary extensions.

File:X11 mac gimp app.jpg
X11.app running rootless on Mac OS X. The screen shows GIMP running within the X window system.
File:Wfm cygwinx rootless.png
Cygwin/X running rootless on Microsoft Windows XP. The screen shows X applications (xeyes, xclock, xterm) sharing the screen with native Windows applications (Date and Time, Calculator).

Up to 2004, the most common X variant on free UNIX-like systems was XFree86, which started as a port of X for 386-compatible PCs and, by the end of the 1990s, had become the greatest source of technical innovation in X and the de facto steward of X development. As of 2004, the most popular open source X server is the current X.Org reference implementation, a fork of XFree86.

While X is most often associated with Unix, X servers also exist natively within other graphical environments. Hewlett-Packard's OpenVMS operating system includes a version of X with CDE, known as DECwindows, as its standard desktop environment. Apple's Mac OS X v10.3 (Panther) includes Apple X11, based on XFree86 4.3 and X11R6.6, with better Mac OS X integration.

Microsoft Windows does not come with support for X, but there are many third party implementations available, both free software such as Cygwin/X, Xming, WeirdMind [1] and WeirdX and proprietary products such as WiredX, Exceed and X-Win32. They are normally used to control X windows applications remotely.

When X is hosted on another windowing system (such as those of Microsoft Windows or Mac OS) the X system is generally "rootless", meaning the host windowing environment is responsible for the root window (the background and associated menus) and for managing the geometry of the hosted X windows — although some servers, such as Exceed, do create the root window for the remote clients to display to as a separate window in the host system.

X terminals

An X terminal is a piece of dedicated hardware running an X server as a thin client. This architecture became popular for building inexpensive terminal parks for many users to simultaneously use the same large server. This use very much aligns with the original intention of the MIT project.

X terminals explore the network (the local broadcast ___domain) using the X Display Manager Control Protocol to generate a list of available hosts that they can run clients from. The initial host needs to be running an X display manager.

Dedicated (hardware) X terminals are no longer common; the same functionality is typically provided at a lower cost with a PC with an X server.

Common criticisms of X

The device independence and separation of client and server does incur an overhead. X's network transparency requires the clients and server to operate separately. In the early days, this gave a significant performance penalty on a standalone system compared to Microsoft Windows or Mac OS (versions 1 to 9), where windowing was deeply embedded in the operating system. 4 to 8MB of RAM was recommended for reasonable performance; until the mid-1990s, this was regarded as bloated compared to Mac OS or Windows. In the present day, Windows and Mac OS X Quartz have internal subsystem separation similar to the client/server divide in X and comparable performance and resource usage to X with KDE or GNOME.

X deliberately contains no specification as to user interface or most inter-application communication. The result was several vastly different interfaces, and applications that did not quite work together. The ICCCM, a specification for client interoperability, is notoriously difficult to implement correctly. Further standards efforts such as Motif and CDE did not remedy matters. This has long been a source of great frustration to users and programmers [2]. Consistency of application look and feel and communication is now generally addressed by programming to a desktop environment, which also avoids having to deal directly with the ICCCM.

Hardware support remains a problem. The performance edge for graphical computing is now in the most advanced graphics functions, which are typically implemented in proprietary drivers written by the manufacturers, and generally for Windows (the largest consumer market) first.

The X server usually manipulates the video hardware directly. This originated with the X developers not always having had access to the operating system kernel. If the server crashes, this can leave the video hardware in an unusable state.

X does not include good network-transparent sound. As users increasingly expect sound, this has led to various incompatible sound subsystems. Most programmers in the past chose to ignore the network issue and simply use local, OS-specific sound APIs. The first generation of client-server sound systems included rplay and Network Audio System. More recent efforts have produced EsounD (GNOME) and ARts (KDE), although these are by no means standard. Another system, Media Application Server, is in development.

Until recently, X did not include a good solution to print what you see on the screen. Many X clients print to PostScript entirely separately from what they send to the server. Xprint was first included in X11R6.3; the client side was good, but many server side implementations were not. The versions from X11R6.8 on are of good quality [3] and are gaining toolkit support.

An X client or session cannot be detached from one server and reattached to another, as with VNC. Work is under way to add this facility to X. There are also workarounds to make the current X server screen available via VNC.

The UNIX-HATERS Handbook devoted an entire chapter, "The X Windows Disaster" [4], to the problems of X in the late 1980s and early 1990s.

Competitors to X

X is the near-universal system for graphics on Unix-like systems. Nevertheless, some people have attempted writing alternatives to and replacements for X. Historical alternatives include Sun's NeWS, which failed in the market, and NeXT's Display PostScript, which was eventually turned into Apple's Quartz for Mac OS X.

Modern attempts to address criticisms of X by replacing it completely include Berlin/Fresco and the Y Window System. These alternatives have seen negligible adoption, however, and the viability of any replacement that is not backwards-compatible with X is widely doubted.

Other competitors attempt to avoid the overhead of X by working directly with the hardware. Such projects include DirectFB and the very small FBUI. These efforts may be made superfluous by the Direct Rendering Infrastructure, which aims to provide a reliable kernel-level interface to the frame buffer.

Other attempts to achieve network transparency in the form of graphical terminal services include VNC (a very low-level system which sends compressed bitmaps across the network; the Unix implementation includes an X server), Citrix MetaFrame (an X-like product for Windows), Tarantella (which provides a Java client for use in web browsers) and NX technology (a bandwidth-saving protocol for remote display).

History

Predecessors

There were several bitmap display systems before X. From Xerox came the Alto (1973) and the Star (1981). From Apple came the Lisa (1983) and the Macintosh (1984). In the UNIX world there was the Andrew Project (1982) and Rob Pike's Blit terminal (1984).

X derives its name as a successor to a pre-1983 window system called W (the letter X directly following W in the Latin alphabet). W ran under the V operating system. W used a network protocol supporting terminal and graphics windows, the server maintaining display lists.

Origin and early development

X was initially conceived at MIT in 1984 as a collaboration between Jim Gettys of Project Athena and Bob Scheifler of the MIT Laboratory for Computer Science. Scheifler needed a usable display environment for debugging the Argus system. Project Athena, a joint project between Digital Equipment Corporation (DEC), MIT and IBM to provide easy access to computing resources for all students needed a platform-independent graphics system to link together its heterogeneous multiple-vendor systems; the window system being developed in CMU's Andrew Project was not available for licensing and no alternatives were available.

The project solved this by creating a protocol that could run local applications and was able to call on remote resources. An initial Unix port of W in mid-1983 ran at one-fifth the speed under V; in May 1984, Scheifler replaced the synchronous protocol of W with an asynchronous protocol and the display lists with immediate mode graphics to make X version 1. X was the first window system environment that was truly hardware and vendor independent.

Scheifler, Gettys and Ron Newman set to work and X progressed rapidly. Version 6 was released in January 1985. DEC was preparing to release its first Ultrix workstation, and X was the only windowing system likely to be ready in time. X6 was ported to DEC's QVSS display on MicroVAX.

Color support was added in Q2 1985 to support the DEC VAXstation-II/GPX, forming what became version 9. Although MIT had licensed X6 to some outside groups for a fee, it was decided at this time to license X9 and future versions under what became known as the MIT License. X9 was released in September 1985.

A group at Brown University ported version 9 to the IBM RT/PC, but problems with reading unaligned data on the RT forced an incompatible protocol change, leading to version 10 in late 1985. By 1986, outside organizations were asking for X. X10R2 was released in January 1986. X10R3 was released in February 1986 and was the first version to achieve wide deployment, with both DEC and Hewlett-Packard releasing products based on it. Other groups ported X10 to Apollo or Sun workstations and even the IBM PC/AT. The first commercial application for X (a mechanical computer-aided engineering system that ran on VAXes and displayed on PCs running an X Server) was demonstrated at the Autofact trade show at that time. X10R4 was the last version of X10, released in December 1986.

Although X10 was interesting and powerful, it had become obvious that a more hardware-neutral redesign of the X protocol was desirable before it was too widely deployed; but the scale of such a complete redesign was beyond the resources available at MIT alone. As it happened, DEC's Western Software Laboratory was between projects. Smokey Wallace of DEC WSL and Jim Gettys proposed that X11 be built at DEC WSL and made freely available under the same terms as X9 and X10. It was started in May 1986. The protocol was finalised in August. Alpha testing of the software started in February 1987, beta testing in May and X11 was finally released on September 15, 1987.

The X11 protocol design was led by Scheifler and extensively discussed on open mailing lists on the nascent Internet. X therefore represents one of the first very large scale open source software projects.

The MIT X Consortium and the X Consortium, Inc.

In 1987, with the success of X11 becoming apparent, MIT wished to relinquish the stewardship of X, but at a June 1987 meeting with nine vendors, the vendors told them they believed that a neutral party was required to keep X from fragmenting in the marketplace. In January 1988, the MIT X Consortium was formed as a non-profit vendor group, with Scheifler as director, to direct the future development of X in a neutral atmosphere inclusive of commercial and educational interests. Jim Fulton joined in January 1988 and Keith Packard in March 1988 as senior developers, with Jim focusing on Xlib, fonts, window managers, and utilities and Keith reimplementing the server. Donna Converse and Chris Peterson joined later that year focusing on toolkits and widget sets, working closely with Ralph Swick of MIT Project Athena. The MIT X Consortium produced several significant revisions to X11, the first being Release 2 (X11R2) in February 1988.

In 1993, the X Consortium, Inc. (a nonprofit corporation) was formed as the successor to the MIT X Consortium. It released X11R6 on May 16, 1994. In 1995, it took over stewardship of the Motif toolkit and the Common Desktop Environment for Unix systems. The X Consortium dissolved at the end of 1996, producing a final revision, X11R6.3.

The Open Group

In mid-1997, the X Consortium passed stewardship of X to The Open Group, a vendor group formed in early 1996 by the merger of the Open Software Foundation and X/Open.

The Open Group released X11R6.4 in early 1998. Controversially, X11R6.4 departed from the traditional liberal licensing terms, as the Open Group sought to assure funding for X's development [5]. The new terms would have prevented its adoption by many projects (such as XFree86) and even some commercial vendors. After XFree86 threatened a fork [6], X11R6.4 was relicensed under the traditional license in September 1998. [7] The Open Group's last release was X11R6.4 patch 3.

X.Org and XFree86

XFree86 originated in 1992 from the X386 server for IBM PC compatibles included with X11R5 in 1991, written by Thomas Roell and Mark W. Snitily and donated to the MIT X Consortium by Snitily Graphics Consulting Services (SGCS). XFree86 evolved over time from being just one port of X to being the leading open source implementation.

In May 1999, the Open Group formed X.Org. X.Org supervised the release of versions X11R6.5.1 onward. X development at this time was moribund [8]; most technical innovation since the X Consortium had dissolved had taken place in the XFree86 project [9]. In 1999, XFree86 joined X.Org as an honorary (non-paying) member [10], encouraged by various hardware companies [11] interested in its use with Linux and its status as the most popular version of X.

By 2003, while Linux's popularity, and hence the installed base of X, surged, X.Org was all but inactive [12] and active development was largely carried out by XFree86. However, there was considerable dissent within XFree86. It was perceived as far too cathedral-like in its development model; developers were unable to get CVS commit access [13] and vendors had to maintain extensive patches [14]. In March 2003, Keith Packard, who had joined XFree86 after the end of the original MIT X Consortium, was expelled with considerable ill-feeling [15] [16] [17].

X.Org and XFree86 began discussing a reorganisation suited to properly nurturing the development of X [18] [19] [20]. Jim Gettys had been pushing strongly for an open development model since at least 2000 [21]. Gettys, Packard and several others began discussing in detail what was needed for the effective governance of X with open development.

Finally, in an echo of the X11R6.4 licensing dispute, XFree86 released version 4.4 in February 2004 under a more restricted license which many projects relying on X found unacceptable [22], particularly as it was held to be incompatible with the GNU General Public License [23]. This caused great controversy, and many considered the time was ripe for a fork [24].

The X.Org Foundation

In early 2004, the X.Org Foundation was formed. This marked a radical change in the governance of X. Whereas the stewards of X since 1988 (including the previous X.Org) had been vendor organizations, the Foundation was led by software developers and used community development on the bazaar model, which relies on outside involvement. Membership was opened to individuals, with corporate membership being in the form of sponsorship. X.Org also started working very closely with freedesktop.org.

The Foundation released X11R6.7 in April 2004, based on XFree86 4.4RC2 with X11R6.6 changes merged. Gettys and Packard had taken the last version of XFree86 under the old license and, by making a point of an open development model and retaining GPL compatibility, brought many of the old XFree86 developers on board [25].

X11R6.8 was released in September 2004. It added significant new features, including preliminary support for translucent windows and other sophisticated visual effects, screen magnifiers and thumbnailers, and facilities to integrate with 3D immersive display systems such as Sun's Project Looking Glass and the Croquet project. Policy for the visual appearance is provided by external applications called compositing managers.

Future directions

With the X.Org Foundation and freedesktop.org, X development is progressing rapidly once more. Present and future releases are intended as usable finished products, not merely a base for vendors to build a product upon.

Hardware manipulation is being moved to the kernel, the plan being for the video hardware to be accessed only via OpenGL (Mesa for systems without hardware OpenGL) and the Direct Rendering Infrastructure module, introduced in XFree86 version 4 and present in X11R6.7 and later [26].

The architecture of the reference implementation is also being separated into independent modules that can each be maintained as separate projects. X11R6.9 will be the monolithic source code and X11R7.0 the modular source code for the same set of features [27]. This is tentatively scheduled for release in October 2005 [28]. The Foundation plans to release X11R7.1 within six months of 7.0, with considerable feature improvements [29].

Nomenclature

"X Window System" is commonly shortened to "X11" or simply "X". The term "X Windows" (in the manner of "Microsoft Windows") is officially deprecated and generally considered incorrect, though it has been in common use since the inception of X and has been used deliberately for literary effect, for example in the Unix-Haters Handbook.

Release history

Version Release date Most important changes
X1 June 1984 First time the software called X; fundamental changes were made that distinguished it from W.
X6 January 1985 First version licensed to a handful of outside companies.
X9 September 1985 Color. First release under MIT License.
X10 late 1985 IBM RT/PC, AT (running DOS), and others
X10R2 January 1986
X10R3 February 1986 First release outside MIT.
X10R4 December 1986 Last version of X10.
X11 September 15, 1987 First release of the current protocol.
X11R2 February 1988 First X Consortium release. [30]
X11R3 October 25, 1988
X11R4 December 22, 1989 Application improvements, new fonts, twm brought in as standard window manager.
X11R5 September 5, 1991 X386
X11R6 May 16, 1994 ICCCM v2.0; Inter-Client Exchange; X Session Management; X Synchronization extension; X Image extension; XTEST extension; X Input; X Big Requests; XC-MISC; XFree86 changes.
X11R6.1 March 14, 1996 X Double Buffer extension; X Keyboard extension; X Record extension.
X11R6.2
X11R6.3 (Broadway)
December 23, 1996 Web functionality, LBX. Last X Consortium release. X11R6.2 is the tag for a subset of X11R6.3 with the only new features over R6.1 being XPrint and the Xlib implementation of vertical writing and user-defined character support. [31]
X11R6.4 March 31, 1998 Xinerama. [32]
X11R6.5 Internal X.org release; not made publicly available.
X11R6.5.1 August 20, 2000
X11R6.6 April 4, 2001 Bug fixes, XFree86 changes.
X11R6.7.0 April 6, 2004 First X.Org Foundation release, incorporating XFree86 4.4rc2. Full end-user distribution. Removal of XIE, PEX and libxml2. [33]
X11R6.8.0 September 8, 2004 Window translucency, XDamage, Distributed Multihead X, XFixes, Composite, XEvIE.
X11R6.8.1 September 17, 2004 Security fix in libxpm.
X11R6.8.2 February 10, 2005 Bug fixes, driver updates.
X11R6.9
X11R7.0
October 2005 (tentative) [34] Driver improvements, minor features, major source code refactoring [35]. 7.0 is to be the modular version and 6.9 the monolithic version of the same source code.
X11R7.1 2006 Larger changes not included in 6.9/7.0 [36].

See also

References

Notable implementations