The Design of X11

Chapter 22: X Window System

22.1 An Introduction to the X Window System

X Window System is a network−based software package that provides the users friendly graphical interface. We will refer to X Window System shortly as X, or X11. X is based on the clientserver model, in which the X client application program does not directly access the display; instead it communicates with the X server the corresponding display program with the single task to control displaying. X was developed at MIT and is maintained by a not−for−profit consortium of vendors and universities, first known as MIT X Consortium, succeeded by X Consortium from 1993. It is a relatively highly standardized package that runs on almost every platform; X appeared relatively late, so it presents a compromise between needs of many vendors. The best known release is X11R6, although version X11R5 is also widely in use. All efforts to standardize X11 culminated in the introduction of Common Desktop Environment CDE, which had offered the best of X11. Today, CDE is the standard part of most UNIX installations, usually accompanied by a vendor−specific flavor of X11. CDE related X components are easy to recognize, they always do have dt prefix in their names stands for DeskTop. X11 presents a highly flexible and configurable package; correspondingly, an adequate administrative effort must be made to optimize X11 for the local site. Nevertheless, X11 can run with its default settings, which is sufficient for most of the implementations. We will discuss those issues in the first part of this Chapter. Although, every clientserver model does have two sides, studying X11 practically means to study the client side; X configuration and customization is always provided on the client host. Today, users are very familiar with the windows environment; almost every PC provides some version of the Microsoft Windows system. Although, MS Windows does not belong to X11, the similarities in the use are obvious; however, the rest is quite different. Nevertheless, credit for a broader introduction of windows as a graphic, user−friendly interface and environment actually should go to Macintosh for its contribution in this arena in the early 1970s.

22.1.1 The Design of X11

We mentioned already that X is based on the clientserver model. One important feature of the clientserver model is that client and server programs can communicate remotely, although, they can also reside at the very same system. An X client and an X server communicate using the X Protocol, which is supported by domain sockets internally and TCPIP externally. Many implementations consist of X servers and X clients running on independent remote machines, mutually connected by fast links. Links could be any kind of distant connections within a wide area network WAN, or mid−speed modem, or, what is the most common, a local area network LAN. This fact makes X ideal in a distributed computing environment — users can open a number of windows on a number of server machines, dealing simultaneously with a number of tasks running on a number of remote client machines. When an X client and an X server are running on distant machines, each of them provides its part of the common task. The X server is a part of the users local display machine; this machine could be very simple, even a single−tasking DOS−based PC. A complex part of the common task is happening at the client side, which is usually, a powerfull, multiuser system capable of running sophistiacted graphic applications. This feature has led to an intensive development of low−cost X terminals, designed especially for running X server. Using X terminals, multiple users can run graphics−intensive programs without a need to possess their own expensive powerful machines. 514 Figure 22.1: An X server with multiple X clients. An X server can run any sort of bitmap graphic displays. A graphic display consists of at least one monitor screen, a pointing device, and a keyboard. They differ regarding: Monitors • different screen sizes, resolutions, color support, etc. Pointing devices • a mouse, a trackball, a touchscreen, a lightpen, etc. Keyboards • a keyboard layout, control sequences The X server insulates X clients from low−level differences; it means that the X server mediates between clients and graphic displays hardware characteristics; it provides mapping between physical resources and corresponding logical identifiers. Unfortunately, the requirement for a configurability could not miss the X application itself. An X application an X client is generally running on a multi−user system, and basically could display on any connected X server on the network. Consequently, there are always dependencies and 515 We have mentioned an application as an X client; however, beside the application itself, other X clients also take part actively in an X display session briefly, an X session. First, the X session must be started similarly to any other character−based session for example, login session is started by init, getty, and login programs involved — recall the login procedure. In the early days of X11, an X session was started by a specific X startup program, like the program xinit. Later, this task was delegated to the X display manager— the program that enables the start of an X session by executing an appropriate user−configurable program. For X11, the first real X display manager was the xdm program alternatively, an X session could be also started by the xinit command. We will return to both issues later. Another client program is an X window manager which provides the basic framework for moving, resizing, and managing windows. This is the only window manager s task, but the crucial one for the entire X session. While in a traditional character−based world, a session is defined by the lifetime of a users login shell, here it is usually the lifetime of the window manager in X environment, a users login process does not necessarily have a terminal−like interface to connect with. The window manager is in charge of performing the flexible and usable concept of windowing, i.e., opening a number of independent windows on a single display, which appears to user, and behaving, as multiple parallel independent displays. Having in mind the restricted display resources the screen dimensions, etc., additional features such as window moving, resizing, overlapping, iconizing, and other had to also be provided. What will be presented in a window does not depend on the window manager; it depends only on the associated client application program, invoked through this window. The window managers could be started independently, or together with the X client application. Finally, a few words about graphic user interface GUI. The concept for a GUI originated in the mid−1970s at Xeroxs Palo Alto Research Center, where the basic GUI elements such as windows, a mouse, and the point−and−click style of software were developed. The first commercially successful product was offered on the Apple Macintosh platform. The look and feel of the Macintosh interface features multiple windows, use of a mouse device, pop−up and pull−down menus, object and process icons, and dialogue boxes, all of which have come to define user−friendly computing environments. Interest in GUIs has grown steadily, especially in the UNIX marketplace where the GUI is running under X Windows — X11 — and makes the computing platform more accessible to a wider range of users. While X11 supplies basic graphic functionality and a networkable windowing system, the GUI implements a particular style of interaction, a look and feel within the X11 environment. On the UNIX platform, X clients are built using a number of programming libraries that make X implementation easier — they insulate the programmer from the very details of the X protocol: The lowest layer is Xlib, which is actually used only in cases where the direct control of the dialogue with the X server is required. • 516 On top of the Xt additional GUI libraries are layered, and they actually, together with a window manager, make a full GUI support. • The three most common GUIs were provided by the Athena widgets, the OSFMotif, and the OPEN LOOK specifications. Each of those specifications also included the corresponding window manager; fortunately, a set of conventions provides interoperability of clients and window managers from different X−based GUIs. Supposing that the X design is more clear now, let us summarize briefly how everything works. X clients and X servers communicate mutually using the X protocol they understand very well. This communication could be local both the X client and X server live on the same machine or remote through the network. X protocol relates to the GUI objects that are well known to both sides in the communication. Instead of transferring large descriptions of the wanted graphic presentations, short messages that refer to appropriate GUI elements are used. We still have the full flexibility with preserved fast communication between a client and a server. In the worst case, when a wanted graphic presentation is not covered by the GUI objects, a full graphic image could be transferred; however, it happens only occasionally. Of course, the price that must be paid is both sides in such a communication, an X client and an X server, should support X protocol. Benefits in using X windowing are numerous. X enables a flexible distribution of resources within the network. The execution of an application and the interaction with the very same application are divided, and could be arbitrary located, optimizing the efficient use of available resources. A number of users could access simultaneously a number of applications, by making an optimal balance between processing and displaying resources. In the distributed computer environment, X makes a step closer to the dream of having a whole network that appears as a single equivalent powerful processing computer system.

22.1.2 The X Administration Philosophy