'''Wayland''' is a new windowing protocol for Linux. Utilization of Wayland requires changes to and re-installation of parts of your system's software. For more information on Wayland see its [http://wayland.freedesktop.org/ homepage].

'''Wayland''' is a new windowing protocol for Linux. Utilization of Wayland requires changes to and re-installation of parts of your system's software. For more information on Wayland see its [http://wayland.freedesktop.org/ homepage].

Line 15:

Line 14:

== Requirements ==

== Requirements ==

−

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

+

Currently Wayland will only work on systems utilizing [[KMS]].

== Installation ==

== Installation ==

Line 33:

Line 32:

=== Usage ===

=== Usage ===

−

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

XWayland ''is'' an XOrg server and compiles as a drop in replacement. The only difference is that it is sourced from the Wayland branch of the xorg-server repository and as such has the Wayland extensions. These extensions allow it to run as a client of Weston.

+

+

When you want to run an X application from within Weston, it spins up this modified X server to service the request.

+

+

{{Warning|The steps in this section set out ''to replace your graphics stack''. An incomplete installation could result in a broken graphical environment.}}

+

+

If you plan to run native X-applications inside Wayland, then you have to install {{AUR|xorg-server-xwayland}} and either patched graphic drivers according to your system, e.g. {{AUR|xf86-video-intel-xwayland-git}}, or the generic wlglamor fallback found at {{AUR|xf86-video-wlglamor-git}}. After that, create or modify following configuration file:

+

{{hc|~/.config/weston.ini|

+

<nowiki>[core]

+

modules=xwayland.so,desktop-shell.so</nowiki>

+

}}

+

Now you can also run X applications in some kind of "compatibility mode". Final XWayland support should be available with the version 1.16 X-server release which is not due to land until [http://www.phoronix.com/scan.php?page=news_item&px=MTQ1NzM mid 2014].

+

+

The AUR packages may require some modification in order to compile successfully though ([https://bbs.archlinux.org/viewtopic.php?pid=1328812#p1328812 see this thread]). An alternative is to compile directly from source. This can be done in 3 steps (it is assumed you already have the {{ic|base-devel}} group installed).

+

+

First install the standard XOrg packages and the appropriate video driver, this will pull in the required dependencies.

+

+

{{Note|Unless you are on a fresh installation, you likely already have these. Just ensure you have the latest versions and if using [[ATI]] or [[NVIDIA]] that you are using the ''open source'' drivers.

+

Wayland graphics hardware support seems to go Intel > ATI > NVidia so YMMV on non-Intel hardware. However the new {{ic|xf86-video-wlshm}} driver has been produced with the purpose of having high compatibility across all hardware stacks. }}

+

+

# pacman -S xorg-server xorg-server-utils xorg-xinit mesa

+

# pacman -S xf86-video-''yourdriver''

+

+

Second, checkout and compile the XWayland xorg server.

+

+

{{Note|If you have 3GB of RAM or more, performing these operations in memory (e.g. {{ic|/tmp}}) is probably a good idea.}}

+

+

{{bc|<nowiki>

+

$ git clone git://anongit.freedesktop.org/xorg/xserver -b xwayland

+

$ cd xserver

+

$ ./autogen.sh --prefix=/usr/ --enable-xorg --enable-wayland

+

$ make

+

+

# make install

+

</nowiki>}}

+

+

Third, checkout and compile your video driver. The repos can be found on [http://wayland.freedesktop.org/xserver.html the official Wayland website]. As noted above, {{ic|xf86-video-wlshm}} is likely a good option for non-Intel graphics.

If your Intel graphics are pre-Sandybridge use {{ic|<nowiki>--with-default-accel=uxa</nowiki>}} instead.

+

+

Now that you have replaced your xorg-server and graphics driver with the XWayland patched versions you should be able to run XWayland.

+

To test, check that you have a small X application like {{ic|xterm}} or {{ic|xclock}} in your path, fire up Weston using {{ic|weston-launch}}, open weston-terminal and run the X application.

== GUI libraries ==

== GUI libraries ==

Line 75:

Line 269:

=== Qt5 ===

=== Qt5 ===

−

You need to install {{Pkg|qt5-base}} and the wayland plugin {{AUR|qtwayland-git}}.

+

You need to either <strike>rebuild {{Pkg|qt5-base}} with ''-opengl es2''</strike> (currently not working, see http://lists.qt-project.org/pipermail/development/2013-December/014789.html ) or use {{AUR|qtbase-git}}. Then build the wayland plugin {{AUR|qtwayland-git}}.

To run a Qt5 app with the Wayland plugin, set {{ic|QT_QPA_PLATFORM&#61;wayland-egl}}.

To run a Qt5 app with the Wayland plugin, set {{ic|QT_QPA_PLATFORM&#61;wayland-egl}}.

Line 87:

Line 281:

=== SDL ===

=== SDL ===

−

Benjamin Franzke is working on a port of SDL to Wayland, it's available in his [http://cgit.freedesktop.org/~bnf/sdl-wayland/ sdl-wayland repo] on freedesktop.org. Further development upon Benjamins work was done by Andre Heider in his [https://github.com/dhewg/libsdl/tree/wl wayland branch] of libsdl. Scott Moreau picked up where others left and fixed the library to work with 1.0 protocol. You can find his work in [https://github.com/soreau/SDL/tree/wayland wayland branch] of SDL repository.

+

Benjamin Franzke is working on a port of SDL to Wayland, it is available in his [http://cgit.freedesktop.org/~bnf/sdl-wayland/ sdl-wayland repo] on freedesktop.org. Further development upon Benjamins work was done by Andre Heider in his [https://github.com/dhewg/libsdl/tree/wl wayland branch] of libsdl. Scott Moreau picked up where others left and fixed the library to work with 1.0 protocol. You can find his work in [https://github.com/soreau/SDL/tree/wayland wayland branch] of SDL repository.

To run a SDL application on Wayland, set {{ic|SDL_VIDEODRIVER&#61;wayland}}.

To run a SDL application on Wayland, set {{ic|SDL_VIDEODRIVER&#61;wayland}}.

Line 103:

Line 297:

=== GNOME ===

=== GNOME ===

+

Since version 3.10, Gnome has experimental Wayland support but you have to install {{AUR|xwayland-git}} and a equivalent patched graphics driver, e.g. {{AUR|xf86-video-intel-xwayland-git}} to get ''Mutter'' to work. For details look into the [https://live.gnome.org/Initiatives/Wayland GNOME wiki]

+

.

+

{{bc|<nowiki>gnome-session --session=gnome-wayland</nowiki>}}

−

GNOME is currently ported to Wayland and will be available in a future version. For details look into the [https://live.gnome.org/Wayland GNOME wiki].

+

=== i3 ===

+

+

Some developers from i3 have [http://www.i3way.org/ sprouted a completely new project] for implementing a shell plugin for Weston to implement the same features and style of i3.

=== Pure Wayland ===

=== Pure Wayland ===

Line 112:

Line 311:

First install a base Arch Linux install with base and base-devel. Do not install xorg or any of its libraries.

First install a base Arch Linux install with base and base-devel. Do not install xorg or any of its libraries.

−

===== Wayland, DRM, Pixman, libxkbcommon =====

+

==== Wayland, DRM, Pixman, libxkbcommon ====

$ pacman -S wayland libdrm pixman libxkbcommon

$ pacman -S wayland libdrm pixman libxkbcommon

−

===== Mesa =====

+

==== Mesa ====

$ sudo pacman -S python2 libxml2 llvm

$ sudo pacman -S python2 libxml2 llvm

Line 125:

Line 324:

$ sudo make install

$ sudo make install

−

===== cairo =====

+

==== cairo ====

Note - no glx/gl or xcb - EGL only.

Note - no glx/gl or xcb - EGL only.

Line 136:

Line 335:

$ sudo make install

$ sudo make install

−

===== weston =====

+

==== weston ====

$ sudo pacman -S gegl mtdev

$ sudo pacman -S gegl mtdev

''(choose mesa-gl from options for libgl)''

''(choose mesa-gl from options for libgl)''

Line 144:

Line 343:

$ make

$ make

$ sudo make install

$ sudo make install

+

+

==Troubleshooting==

+

+

=== LLVM assertion failure ===

+

If you get an LLVM assertion failure, you need to rebuild {{Pkg|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:

XWayland

XWayland is an XOrg server and compiles as a drop in replacement. The only difference is that it is sourced from the Wayland branch of the xorg-server repository and as such has the Wayland extensions. These extensions allow it to run as a client of Weston.

When you want to run an X application from within Weston, it spins up this modified X server to service the request.

Warning: The steps in this section set out to replace your graphics stack. An incomplete installation could result in a broken graphical environment.

Now you can also run X applications in some kind of "compatibility mode". Final XWayland support should be available with the version 1.16 X-server release which is not due to land until mid 2014.

The AUR packages may require some modification in order to compile successfully though (see this thread). An alternative is to compile directly from source. This can be done in 3 steps (it is assumed you already have the base-devel group installed).

First install the standard XOrg packages and the appropriate video driver, this will pull in the required dependencies.

Note: Unless you are on a fresh installation, you likely already have these. Just ensure you have the latest versions and if using ATI or NVIDIA that you are using the open source drivers.
Wayland graphics hardware support seems to go Intel > ATI > NVidia so YMMV on non-Intel hardware. However the new xf86-video-wlshm driver has been produced with the purpose of having high compatibility across all hardware stacks.

Third, checkout and compile your video driver. The repos can be found on the official Wayland website. As noted above, xf86-video-wlshm is likely a good option for non-Intel graphics.
Following are the instructions for Intel hardware.

If your Intel graphics are pre-Sandybridge use --with-default-accel=uxa instead.

Now that you have replaced your xorg-server and graphics driver with the XWayland patched versions you should be able to run XWayland.
To test, check that you have a small X application like xterm or xclock in your path, fire up Weston using weston-launch, open weston-terminal and run the X application.

To run a Qt5 app with the Wayland plugin, set QT_QPA_PLATFORM=wayland-egl.

Clutter

The Clutter toolkit has a Wayland backend that allows it to run as a Wayland client. The backend is enabled in the official package in extra.

To run a Clutter app on Wayland, set CLUTTER_BACKEND=wayland.

SDL

Benjamin Franzke is working on a port of SDL to Wayland, it is available in his sdl-wayland repo on freedesktop.org. Further development upon Benjamins work was done by Andre Heider in his wayland branch of libsdl. Scott Moreau picked up where others left and fixed the library to work with 1.0 protocol. You can find his work in wayland branch of SDL repository.

To run a SDL application on Wayland, set SDL_VIDEODRIVER=wayland.

EFL

EFL has complete Wayland support.
To run a EFL application on Wayland, see Wayland project page.