DISCLAIMER: This post is written by a complete novice. Information stated may be inaccurate and if so, feel free to correct any mistakes.
RESEARCH TOPIC: Linux GUI stack
WHAT PROMPTED THIS RESEARCH?: I stumbled across a process called 'xorg' and wondered what that is. A quick Google search shows it has something to do with displaying graphics and so begins the journey of trying to understand the Linux GUI stack on a surface level.
In a windowing system, there are 2 main components: the display server and the window manager.
- Display server
- The display server protocol specifies communication between a client (GUI application) and the display server
- Relays inputs (keyboards, mouse, touchscreen etc.) to clients
- Displays the output onto a screen
- Window manager
- Works hand-in-hand with a display server
- Manages the placement and appearance of windows
- Display server
There are 2 main types of windowing system used in GUI Linux operating systems today: X11 and Wayland.
- X.Org server (display server) + Mutter/KWin (window manager)
- X.Org server is the dominant implementation of the display server for X Window System (X11 Protocol).
"In the case of X11, A window manager is a regular X client. It doesn’t have any superuser privileges or keys to kernel backdoors; it is a normal user process that is allowed by the X server to call a set of special APIs. X ensures that no more than one window manager is running at any given point by denying a client access to these APIs if another client currently has access. The first client to attempt to access these APIs always succeeds." - How X Window Managers Work, And How To Write One (Part I)
- Mutter/KWin Wayland compositor (Display server + window manager)
- Wayland, unlike its X11 counterpart, does not have network transparency in order to simplify its architecture.
I was curious as to how a wayland client would communicate to the display server (wayland compositor). In wayland’s case, it would look for a unix socket (ipc socket) typically named wayland-0. https://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-Wire-Format
Linux GUI toolkits (QT, GTK) now supports both X11 and wayland protocol.
- "A window manager is a system software that controls the placement and appearance of windows within a windowing system in a graphical user interface." - Window Manager on Wikipedia
- There are 2 notable types of Window Managers: Stacking and Tiling window managers.
- Mutter/Kwin - more precisely a compositing window manager
- i3 (X11 Tiling window manager)
- Sway (Tiling wayland compositor)
- A display manager presents the user with a login screen. A session starts when a user successfully enters a valid combination of username and password.
- Examples are GDM, KDM and LightDM.
- Ubuntu uses GDM by default.
- GDM runs on wayland. Display managers that run on X, on the other hand, starts up the X server before displaying the login UI.
- GDM starts in TTY1 and on user login, it starts up the user session on TTY2. Why is my GDM at a different TTY than my desktop environment? Just a question: Is it possible to start greeter and user screen in the same TTY? Another question: *Session manager https://www.systutorials.com/docs/linux/man/1-gnome-session/ So the method of starting a window manager directly without a display manager does not use a session manager? What does that mean for a user?
- "A desktop environment (DE) usually rides on top of a Window Manager and adds many features, including panels, status bars, drag-and-drop capabilities, and a suite of integrated applications and tools. " - zeal
- You can run standalone window managers without the need of a desktop environment.
- See desktop environments vs window managers
- Examples include GNOME and KDE.
- Developers use these toolkits to ease development. They do not need to know the intricacies of X11/Wayland to start developing apps for the platform.
- Examples of GUI toolkits are QT and GTK.
- POP!_OS and Regolith OS looks pretty sick.
- What's Chrome OS GUI stack like?
- MacOS - Quartz Compositor ?