Architecture of the X Window System

The X Window System has a networked architecture based on the traditional client-server model which differentiates it so much from other GUI approaches such as the ones used by Windows or Apple operating systems. The X server is the program that provides the display capability, running on a computer with a bit-mapped display. On the other hand, the X applications or clients are the programs that make use of the resources from the X server.

Perhaps we need a little bit more clarification here, since the client-server model is sort of reversed in the case of the X Window System, thus making it so difficult to understand for novice users. The X server is the machine whose video display is being used for X, which could perfectly be the local machine, while the X client offers nothing but the applications themselves that can be run remotely.

It is this networked architecture that allows an enormous flexibility to any system administrator in charge of UNIX boxes. For example, it makes it relatively easy to set up and run X terminals that do not have beefy hardware but rather run all the applications from a remote host. In that case, the X server will be running locally on the terminals (i.e., the video display or card is running locally), but the applications are actually sitting on a completely different host somewhere else. This also allow for running special X servers on the Windows platform (such as VNC or Exceed) so that we can run UNIX applications remotely.

X client programs communicate with the X server through the X network protocol. This protocol consists of two types of messages: requests from the software to the hardware (such as: \”draw a blue circle in the middle of the screen\”), and events (reports to the software about things that happen at the hardware level, such as mouse movement or a keyboard entry).

Two other important components of the X Window System are the toolkits and the window managers. The toolkits are high-level programming libraries that contain both low level routines or intrinsic libraries (set of object-oriented routines that implement some basic functions). Perhaps one of the best known toolkits to this date has been the the Xm or Motif toolkit, which has recently been released as open source. These toolkits make it a lot easier for programmers to write applications, since they do not have to worry about writing every single behavior into their programs. However, they also impose a certain look and feel. Other important toolkits much more popular in the open source community are the Qt libraries used in KDE, and the GTK used in Gimp and Gnome. On the other hand, the window managers are special applications that shape the look and feel of the X session. They basically control the way all windows are decorated. Some of the most popular window managers are WindowMaker, AfterStep, FVWM, and Enlightenment, although there are many more.

Finally, Linux has seen the appearance of a new breed in the last couple of years. I am referring to the desktop environments, such as the abovementioned KDE and Gnome. These provide not only a generacl look and feel, but also some sort of cohesiveness and integration among all the applications, making it possible to drag and drop icons, embed information from one application onto another, etc. Needless to say, these desktop environments are still under heavy development, and even though they are pretty stable right now there is no doubt in anybody\’s mind that they have not reached their full potential yet.