Since the release of Raspberry Pi OS Bookworm (previously called Raspbian), the default display server now runs on Wayland. But depending on your hardware, Wayland might be slower on your Raspberry Pi or certain GUI applications don't work as they haven't been adjusted to work with Wayland.
Desktop freeze
In my particular situation a Raspberry Pi 4B 2GB was installed with the latest Raspberry Pi OS Bookworm to use it as a monitoring station. Chromium browser would remain open and a tab rotator add-on would switch between different monitoring overviews and observability dashboards.
However after a few days, the Desktop froze and Raspberry Pi needed to be rebooted (SSH was still working). This happened three times, after running for a couple of days.
Maybe X11 would be more stable on this older hardware?
Switching from Wayland to X11
Luckily a switch from Wayland to the older but proven stable X11 Desktop backend is not complicated. Just open the Raspberry Pi configuration by running the following command in a terminal:
$ sudo raspi-config
A (NCurses) menu comes up and offers you different configuration options.
Use your keyboard arrows and select "6 Advanced Options", confirm with the [Enter] key:
In the next next, select A6 Wayland:
Now you can choose between X11 (X11 backend) or Wayfire (Wayland backend). By default Waywire is selected. Change the selection and select X11:
You should get a confirmation that X11 is now active:
You should now be back in the "main menu" of the Raspberry Pi configuration. Choose "Finish" now.
In order to use the X11 Desktop now, you need to reboot. By finishing the Raspberry Pi configuration, this prompt comes up and asks you to reboot or not. You can also reboot later but only a reboot will switch the Desktop from Wayland to X11.
Reviewing the Switch to X11
After running more than a week on X11, the Raspberry Pi Desktop seems faster and definitely more stable than previously with Wayland. I have not experienced a single freeze – yet.
One negative side effect is that the default VNC Server (wayvnc) on Raspberry Pi does not work anymore, as this software is programmed for the Wayland backend. You would need to install a different VNC server in this case (but there are plenty of options, e.g. TigerVNC).
About VNC, after I booted up de RPi, I ran raspi-config and enabled VNC again and it started to work again. The only thing I got differente was the RealVNC icon on the desktop manager and an insecure connection warning when used the Tiger VNC Viewer.