A Look Inside Linux series
A series of short topics on how Linux works and how to make it work the way you want it to, which I present during the weekly sessions of the Linux User Net. The target audience is Hams who are new to Linux and want to know more about it, as well as experienced Linux users who can learn more about their chosen operating system. These are my notes for the presentations. (Russ, KC7MM)
Having covered the Linux kernel, the application layer and the graphics layer, we find ourselves at the top layer of the “cake”. This is the graphical user interface, commonly referred to by its acronym: GUI, or “gooey”.
The most common model of a GUI follows the interface developed by Xerox at its Palo Alto Research Center, and popularized by Apple with the McIntosh. It's based on using keyboard and mouse to manipulate windows.
Not surprisingly, this GUI model is the one most used on Linux systems (there are others that we'll ignore for now).
We saw last week that a Linux system can (optionally) have a graphics layer, or subsystem, installed. Developers have constructed a window-based GUI layer by stacking three sublayers on top of it:
Let's take a look at each of them, in turn.
We saw last time that the graphics subsystem (X11 or Wayland) provides “window primitives” that can be used to create graphical user interfaces. So, what is a window, and how does it work?
We saw last time that the graphics subsystem (X11 or Wayland) provides graphics primitives. These are basic geometric elements – points, lines, arcs – that can be composed into screen images. They are the building blocks for screen graphics. These can be drawn inside windows to create the shapes, images, and text that we see on the screen.
The job of a window manager is to use the primitives provided by X to build the graphical screen elements that comprise a user interface: movable windows, menus, toolbars, buttons, text boxes, etc.
It also endows them with the actions that enable us to use the interface: clicking, scrolling, dragging, typing, and many more.
The result is a set of graphical components that can be assembled into a user interface: a virtual desktop.
As users of graphical interfaces, our experience with “windows” is that they are framed-in areas that contain running applications. At the window manager level, however, every screen element is a window.
As an example, think of a button somewhere in your screen. It has:
The result is something that looks like a button and acts like a button, but is, in fact, a window. All GUI elements work in a similar fashion.
Once a window manager is in place, it can be used to create a graphical user interface. This generally follows the model of a desktop presented on the screen.
The desktop is built on top of a window manager; that is, it employs the capabilities of the WM to display and control the desktop's elements. It runs in a shell as an application, with root permissions.
The desktop makes available to the user the basic features of a GUI:
It also includes a virtual terminal for use in system administration and running programs.
While a desktop provides a minimal interface for the user to operate the computer, it gives little more that that. Users today, though, have grown accustomed to more elaborate interfaces, ones that make it easier to to use the computer and its installed applications.
For that, we have the desktop environment. This starts with a virtual desktop, to which is added a bunch of graphical utilities for user convenience. Among them are:
Popular desktop environments include KDE, Gnome, Cinnamon, MATE, XFCE, and LXDE/LXQT. There are many others. In fact, the creation of a new desktop environments is one of the prime motivations for making a new Linux distribution.
I won't go into detail on the various environments now; that's a topic for another day.
Today we looked at how a modern graphical user interface is built on top of the Linux graphics subsystem:
Keep in mind that this hierarchy describes the GUI from the perspective of a programmer, for the purpose of understanding how graphics systems work on Linux.
In reality, these three terms tend to be used interchangeably – which can be a bit confusing. For example, you'll find XFCE in lists of window managers, desktops, and desktop environments. You just need to know that they all refer to the same thing.
This wraps up our look at the “layers” that make up a Linux computer system. I hope you found it useful.