Difference between revisions of "Wayland"

From ArchWiki
Jump to: navigation, search
(GTK+: style)
Line 16: Line 16:
== Installation ==
== Installation ==
You need to build and install [http://aur.archlinux.org/packages.php?ID=40796 libxkbcommon], [https://aur.archlinux.org/packages.php?ID=46431 libwayland-git] and [https://aur.archlinux.org/packages.php?ID=51931 mesa-full-wayland] from [[AUR]]. Replacement of the Mesa stack is required because the stock one does not support Wayland.
You need to build and install {{AUR|libxkbcommon}}, {{AUR|libwayland-git}} and {{AUR|mesa-full-wayland}} from [[AUR]]. Replacement of the Mesa stack is required because the stock one does not support Wayland.
== Usage ==
== Usage ==

Revision as of 15:19, 20 December 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary end

Wayland is a new windowing protocol for Linux. Utilization of Wayland requires changes to and re-installation of parts of your system's software. Therefore this article will assume you are familiar with ABS - The Arch Build System, or at the least the ideas behind PKGBUILD and makepkg. For more information on Wayland see its homepage.

Warning: Wayland is under heavy development and is still an early experiment. Support can not be guaranteed and it may not function as you expect.


Currently Wayland will only work with on a system that is utilizing KMS.


You need to build and install libxkbcommonAUR, libwayland-gitAUR and mesa-full-waylandAUR from AUR. Replacement of the Mesa stack is required because the stock one does not support Wayland.


As Wayland is only a library, it is useless on its own. To use it, you need the demo applications (wayland-git in AUR), Qt with QPA (Lighthouse) support and Wayland plugin, and/or GTK with Wayland support.

Demo applications


You need to build and install cairo-gl-git and wayland-git from AUR.


Now that Wayland and its requirements are installed you should be ready to test it out. Try switching to a terminal and running:

# wayland-compositor -b /backgroundimage.png

Note I was having trouble with keyboard & mouse not working unless this was run as root

You can also try:

# EGL_DRIVER=/usr/lib/egl/egl_gallium.so

if you have troubles with nouveau driver.

Then at a TTY you can run the demos:

# wayland-terminal

Should launch a terminal emulator.

# wayland-flower 

Moves a flower around the screen. This tests the frame protocol.

# wayland-gears

Runs glxgears on Wayland.

# wayland-image

Loads the image files passed in the command and displays them.

# wayland-view

Displays PDF files. This needs to be passed file URIs (file:///path/to/pdf).



You need to build and install qt-qpa from AUR. It contains a development version of Qt 4.8 compiled with QPA (Lighthouse) support. It installs into /opt/qt-qpa because it's binary incompatible with non-QPA version of Qt (like the stock one).


At first, you need a working Wayland compositor, like the one from demo applications, or an experimental version of KWin.

Then compile any qmake-based Qt project:

# export PATH=/opt/qt-qpa/bin:$PATH
# export LD_LIBRARY_PATH=/opt/qt-qpa/lib
# qmake
# make

And run it by executing the compiled binary:

# export LD_LIBRARY_PATH=/opt/qt-qpa/lib
# export QT_QPA_PLATFORM=waylandgl
# ./binaryname

Qt Compositor

There is ongoing work to make Qt-Compositor, a base layer to make custom Qt compositors on top of Wayland.

Other GUI libraries

(page from official website)


With GTK+ 3.0, GTK+ gained support for multiple backends at runtime and can switch between backends in the same way Qt can with lighthouse. The Wayland support is on the upstream GTK+ master branch but disabled by default. To try GTK+ on Wayland, check out gtk+ and pass --enable-wayland to configure:

# git clone git://git.gnome.org/gtk+
# cd gtk+
# ./configure --prefix=/usr --enable-x11-backend --enable-wayland-backend --enable-debug=yes
# make

When both Wayland and X backends are enabled, GTK+ will default to the X11 backend, but this can be overridden by setting the GDK_BACKEND environment variable to wayland.

Note: Alternatively, you can install gtk3-gitAUR from the AUR.


The Clutter toolkit has a Wayland backend that allows it to run as a Wayland client. The backend is a bit out of date, but it's in the master branch of the main repo and can be activated by passing --with-flavour=wayland to the configure script.


Benjamin Franzke is working on a port of SDL to Wayland, it's available in his sdl-wayland repo on freedesktop.org.

Window managers and desktop shells


The KDE Wayland support is expected to come in three phases, with the first two phases expected to be completed next year during the KDE SC 4.8 and 4.9 development cycles. Please see here for details.

Also, there is early work to make it possible to run KWin (KDE's window manager) on Wayland.


GNOME will be ported to Wayland in a future version.


MeeGo will be ported to Wayland in a future version.


Ubuntu desktop shell Unity, using Compiz window manager, was announced to be ported to Wayland.

More Information

For more information you can see the ongoing forum discussion on Wayland.