X Window System

From LQWiki
(Redirected from X Windows)
Jump to navigation Jump to search

The X Window System (X or X11 for version 11, for short) is a platform independent method of providing graphics and windowing capabilities to an operating system, while also being network transparent. It is most commonly used on Unix and Unix-like systems such as Linux. X itself dates back to 1984 at MIT.

While other systems for providing graphical windowing capabilities are possible, the standard system on Linux is the X Window System. X, for all its spots, does a good job at what it was designed to do, which is why it has lasted so long in one form or another.

X mechanics

Essentially, what X provides is a program (the X server) which controls the graphics card and performs actual graphics drawing tasks such as splitting the screen into windows, drawing the mouse pointer, drawing lines, accessing the keyboard, etc. It runs the actual video driver, as well as provides an interface through which other programs can issue drawing commands (using the X11 protocol), get input, etc, without having to know what hardware its running on. The goal of X has always been to provide only the mechanism, never policy.

Programs which attach to the X server are called X clients, and may include applications such as word processors, games, etc.

The X protocol is the low level communication protocol used by the client to talk to the server. This core protocol is designed to support X server extensions, encouraging new functionality to be added without having to alter the core protocol.

Window managers

One client is special, and is the window manager - X on its own does not manage drawing the window widgets (title bar and borders) and minimizing, maximizing, raising, and other specifics - this is delegated to the window manager. Before desktop environments became more commonly used, the window manager was the primary piece of software responsible for determining the look and feel of the GUI, however, window managers can only address look and feel at the window level - within the application consistency is derived from the use of a common toolkit, which was not a feature of X applications previously. Many window managers are available, such as Window Maker, Enlightenment, and FVWM.

Network capabilities

X is notable in a number of ways as a graphical interface system. One interesting feature is that, since the X protocol is designed to operate as a serialized sequence of commands, it supports operating transparently over a network. Thus, an X client may run on a remote machine in almost the same way as one can run locally. Its windows will appear on the screen just like other programs running on the local system. However, a program running locally will use more efficient communication mechanisms such as Unix sockets and SHM than a remote program, and hence will be significantly faster and more efficient.

This networking capability combined with true multi-user operating systems permits much more efficient use of hardware. Many desktop users only use a few percent of the CPU power of their machine. Using X, an ordinary PC can allow thirty or so users to login remotely and drive the CPU utilization upwards. This is widely used in computer labs and offices where many users are in close proximity. Moreover, X can be used to permit more than one display per machine with multiple multi-head graphics interfaces, so the cost of hardware is spread over more users. For example, a barebones PC with 64 bit processor, 512 MB RAM and no hard drive may be used as a thin client with extra graphics cards and USB ports for mice and keyboards. If the thin client costs $600 and has six users simultaneously active, the cost of the thin client per seat is only $100 plus the cost of a mouse/keyboard/monitor set. Using multi-core multi-socket motherboards in a server one can run all the desktop applications of hundreds of users from a single server. The cost of such a terminal server running LTSP (Linux Terminal Server Project) may be as little as $30 per seat, so the cost per seat is about $130 + networking + display/keyboard/mouse. X is truly a major threat to widely used proprietary systems when combined with GNU/Linux.

The X protocol is extensible through extension, so new features can be added as time goes on. For example, some recent features that were added include support for anti-aliased fonts, truetype fonts, alpha-blending, and hardware-accelerated 3D graphics.

Criticism

The X Window System has been criticized in recent times for a number of reasons. The most common criticisms are that its dependence on the X protocol renders it less efficient than some other styles of GUI design, and that the X Protocol itself is showing its age and does not provide features popular in modern GUI systems. While these criticisms have been quite popular in some circles, there is widespread disagreement with their conclusions. In any case, it would be very impractical to replace X11, since so much software already exists for it. A number of projects exist to continue to improve X11 and keep it up to date with developments in computer graphical interfaces.

One criticism of X is that it uses much bandwidth. This is important when many users are connected to some limited resource or through a slow connection. Another is that the information transmitted is in the clear so intruders can sniff. Where security is a concern, X may be forwarded over a more secure protocol such as SSH. NoMachine developed an improvement on X by modifying the protocol to use fewer transactions and forwarding over SSH. NX and FreeNX permit remote graphical connections to be useful even over dial-up.

Alternatives

Controlling

Some useful scripts and code examples for advanced users wanting better control of their X Windows implementation.

See also

External links