Wayland

Wayland is a protocol for a compositing window manager to talk to its clients, as well as a library implementing the protocol. It is supported on some desktop environments like GNOME and KDE. There is also a compositor reference implementation called Weston. XWayland provides a compatibility layer to seamlessly run legacy X11 applications in Wayland.

Requirements

Most Wayland compositors only work on systems using Kernel mode setting. Wayland by itself does not provide a graphical environment; for this you also need a compositor such as #Weston or Sway, or a desktop environment that includes a compositor like GNOME or KDE.

For the GPU driver and Wayland compositor to be compatible they must support the same buffer API. There are two main APIs: GBM and EGLStreams.

Shell font

Tips and tricks

Screencast recording

Weston has built-in screencast recording which can be started and stopped by pressing the Super+r key combination. Screencasts are saved to the file capture.wcap in the current working directory of Weston. The WCAP format is a lossless video format specific to Weston, which only records the difference in frames. To be able to play the recorded screencast, the WCAP file will need to be converted to a format which a media player can understand. First, convert the capture to the YUV pixel format:

$ wcap-decode --yuv4mpeg2 capture.wcap > capture.y4m

The YUV file can then be transcoded to other formats using FFmpeg or x264 (see x264 -h for more).

Window switching

To switch windows with Super+Space instead of Super+Tab use the following patch:

LLVM assertion failure

If you get an LLVM assertion failure, you need to rebuild mesa without Gallium LLVM until this problem is fixed.

This may imply disabling some drivers which require LLVM. You may also try exporting the following, if having problems with hardware drivers:

$ export EGL_DRIVER=/usr/lib/egl/egl_gallium.so

Slow motion, graphical glitches, and crashes

Gnome-shell users may experience display issues when they switch to Wayland from X. One of the root cause might be the CLUTTER_PAINT=disable-clipped-redraws:disable-culling set by yourself for Xorg-based gnome-shell. Just try to remove it from /etc/environment or other rc files to see if everything goes back to normal.

Electron based applications / VS Code

Try running with GDK_BACKEND=x11. Example alias:

$ alias code='GDK_BACKEND=x11 /usr/bin/code 2>/dev/null'

Screen recording

Currently only green-recorderAUR supports screen recording on Wayland (requires a GNOME session).

Remote display

(20161229) there was a merge of FreeRDP into Weston in 2013, enabled via a compile flag. The weston package does not have it enabled.

Input grabbing in games, remote desktop and VM windows

In contrast to Xorg, Wayland does not allow exclusive input device grabbing, also known as active or explicit grab (e.g. keyboard, mouse), instead, it depends on the Wayland compositor to pass keyboard shortcuts and confine the pointer device to the application window.

This change in input grabbing breaks current applications' behavior, meaning:

Hotkey combinations and modifiers will be caught by the compositor and won't be sent to remote desktop and virtual machine windows.

The mouse pointer will not be restricted to the application's window which might cause a parallax effect where the location of the mouse pointer inside the window of the virtual machine or remote desktop is displaced from the host's mouse pointer.

Wayland solves this by adding protocol extensions for Wayland and XWayland. Support for these extensions is needed to be added to the Wayland compositors. In the case of native Wayland clients, the used widget toolkits (e.g GTK, QT) needs to support these extensions or the applications themselves if no widget toolkit is being used. In the case of Xorg applications, no changes in the applications or widget toolkits are needed as the XWayland support is enough.

wlroots input inhibitor protocol

Input inhibitor is a Wayland protocol which was defined the by developers of Sway and wlroots and is overlapping Wayland's Compositor shortcuts inhibit protocol.
Sway and wlroots do not support the Compositor shortcuts inhibit and XWayland keyboard grabbing protocols, and it seems they are against adding support for the latter [4][5].
No widget toolkit or application is known to support this protocol.