4

What Is the Difference Between Display Server, Display Manager, and Window Manag...

 2 years ago
source link: https://www.makeuseof.com/difference-display-server-display-manager-window-manager/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

What Is the Difference Between Display Server, Display Manager, and Window Manager?

By MUO Staff

Published 11 hours ago

If you use Linux you've probably heard of the display server, display manager, and window manager. But what are they and how do they work together?

One of the fascinating things about Linux is the ability to see different system components. One of the most important components of a Linux system is the desktop environment. It allows you to get the most out of your computer, by providing several functions like logging in, launching apps, displaying widgets like the panel, and so on.

Hence, it's a complicated piece of software.

Here, we will clear up some of this complexity by explaining three of the most important components of a desktop environment: the display server, the window manager, and the login manager.

1. The Display Server

display_server.svg

The display server lies at the base of the desktop environment. The display server's main job is to handle low-level drawing functions, which means that it draws directly to the screen. Other graphical programs don't directly draw on the screen; instead they send drawing requests to the display server, which draws on the screen for them.

To put it simply, the display server gives applications pixel access. So all applications that need pixel access will talk to the display server. For instance, if an app wants to create a window, they request the display server to create that window. Another example of applications that require pixel access are screen recorders, they get screen data by an API provided by the display server.

Any application that depends on the display server is said to be a client. The display server is responsible for managing the communication between its clients and hardware devices. It sends signals of keyboard and mouse events to its clients.

The display server is also responsible for drawing the mouse pointer and controlling its position.

X11 and Wayland are the two main options of display servers. X11 is much older than Wayland. In fact, Wayland was developed to be the successor of X11. However, X11 is still widely used among Linux distros.

The concepts mentioned above apply to both X11 and Wayland. However, there are major differences between them in the way they communicate with their clients. Wayland clients are more isolated than X11 clients. Thus, Wayland is considered more secure than X11.

There are other differences that you might consider if you plan to switch to Wayland, but in most cases, you don't have to care about these differences. That's because app developers use high-level toolkits (like Gtk+ and Qt) which support both X11 and Wayland. Also GNOME and KDE work with both X11 and Wayland.

Read More: What You Need to Know About Using Wayland

After understanding what is a display server and what it does, let's move on to the next component.

2. The Window Managerwindow-manager

The window manager's function (as its name suggests) is to manage open windows. Window management involves controlling the size of windows and their position (as requested by you or applications). So whenever you start dragging a window around or resizing it, the window manager is responsible for processing your request.

Remember that in order to drag a window you simply click on its titlebar, while to resize you click and drag on its borders. That moves us to the next function of window managers, which is drawing decorations around windows (the titlebar and borders are called window decorations).

You may be asking, why doesn't the display server handle window management? Well, it does. In reality, window managers do what they do by communicating with the display server. As controlling windows and drawing their decorations require pixel access, they require talking to the display server. So the window manager just instructs the display server, and the display server does the actual operations.

Another important feature that a window manager may have is window compositing. If it has this feature, then it's called a window compositor. That enables applications to do some cool stuff, like allowing transparency, blur, drawing window shadows, animating windows when they are moved/minimized/maximized, and other visual effects.

Examples of Window Managers

There are plenty of options available (unlike display servers, where there are only two options). Among the most popular are:

  • Kwin (comes with KDE).
  • Mutter (comes with GNOME).
  • Xfwm (Xfce's window manager).
  • Muffin (a fork of mutter for Cinnamon desktop).

There are many other options available, some come as a part of a desktop environment, others are developed as single packages. You can even use a window manager alone instead of a full desktop environment.

Some desktop environments will allow you to use a third-party window manager. For example, you may choose to use Xfce with kwin. While GNOME & Cinnamon don't support third-party window managers (for example if you tried to forcefully replace muffin in a Cinnamon session with another window manager, the panel will disappear).

Now you understand the window manager let's move to the next component.

3. The Login Manager (or Display Manager)

gnome list of users

The login manager is the first graphical program that shows up to give you a list of users so you select one and login. It also gives you the option to choose the desktop environment you want. This enables you to switch between desktop environments simply by logging out, choosing another desktop environment, and logging in again. That's why the login manager is called a display manager (not to be confused with the display server).

The login manager identifies the currently installed desktop environments by looking into /usr/share/xsessions directory. This directory contains several .desktop files. Each file corresponds to one of the currently installed desktop environments.

There are also many login managers around. The most popular are:

  • Gdm (GNOME display manager).
  • Kdm (Kde display manager).
  • lightdm (Many desktop environments and Linux distros come with lightdm because it's very customizable and flexible).

The three aforementioned components are the most essential components of any desktop environment. That means that in order to have a functional graphical environment you should at least have those packages installed. However, complete desktop environments get shipped with various other packages that have more specific jobs.

Other Common Components of a Desktop Environment

In addition to the above components, the desktop environment you are using probably contain the following packages:

  • Wallpaper manager: Responsible for setting the wallpaper on your desktop.
  • File manager instance for the desktop: Responsible for displaying desktop icons, this comes as a part of the file manager installed on your system. For instance, nautilus file manager has "nautilus_desktop" and nemo has "nemo_desktop".
  • Screen locker: It locks your computer after a while of disuse.
  • Network Manager: Network Manager is what manages your internet connections and automatically switches between Wi-Fi and wired connection. The program itself does not add any visual elements to your desktop, but your desktop environment must have implemented a GUI for it, accessible from the panel or elsewhere.
  • Notification daemon: When an application wants to show a notification, it sends it to the Notification daemon to display it.
  • Policy Kit authentication agent: This is like a GUI for sudo. This app pops up when you do actions that require root privileges like installing software or applying updates.
  • And many others.

Notice that setting the wallpaper and displaying desktop icons are handled by two separate applications. Also, complete desktop environments come with many other packages that are beyond the scope of this article.

Know the Internals of Your System

For Linux users, knowing the components of their desktop environment is essential for troubleshooting and fixing problems. This knowledge may also become in hand if you decide to build your own desktop environment.

Related Topics

About The Author

MUO Staff

Subscribe to our newsletter

Join our newsletter for tech tips, reviews, free ebooks, and exclusive deals!

Click here to subscribe

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK