Difference between revisions of "Wayland"

From ArchWiki
Jump to: navigation, search
(It's going to extra! Wee!)
(SDL)
(40 intermediate revisions by 19 users not shown)
Line 1: Line 1:
 
[[Category:X Server]]
 
[[Category:X Server]]
 +
[[fr:Wayland]]
 
[[ja:Wayland]]
 
[[ja:Wayland]]
 
[[zh-CN:Wayland]]
 
[[zh-CN:Wayland]]
Line 17: Line 18:
  
 
== Installation ==
 
== Installation ==
Just install {{pkg|wayland}} from extra and {{pkg|mesa}} (and all its related packages) from testing (as Mesa from extra does not currently support Wayland).
+
Wayland is most probably installed on your system already as it is an indirect dependency of {{pkg|gtk2}} and {{pkg|gtk3}}.  If it is not installed, you will find the {{pkg|wayland}} package in extra.
  
 
== Usage ==
 
== Usage ==
As Wayland is only a library, it is useless on its own. To use it, you need a compositor (like Weston), Weston demo applications, Qt5 (or Qt4 with QPA enabled) with Wayland plugin, and/or GTK+ with Wayland support.
+
As Wayland is only a library, it is useless on its own. To use it, you need a compositor (like Weston), Weston demo applications, Qt5 with Wayland plugin, and/or GTK+ with Wayland support.
  
 
== Weston ==
 
== Weston ==
 
=== Installation ===
 
=== Installation ===
You need to build and install {{AUR|weston-git}} from the [[AUR]].
+
You need to install {{pkg|weston}} from community.
{{Note|If you get the following error: "Failed to create XKB context", install {{Pkg|xkeyboard-config}}: {{ic|# pacman -S xkeyboard-config}} }}
+
  
 
=== 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:
 
Now that Wayland and its requirements are installed you should be ready to test it out. Try switching to a terminal and running:
 
  $ weston-launch
 
  $ weston-launch
{{Note|There may be some trouble with keyboard & mouse not working unless this is ran as root.}}
+
{{Note|You need to be in the video group for Weston to start; this command is not supposed to be run as root and doing that may freeze your VT. }}
 +
{{Note|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:  
 
You may also try exporting the following, if having problems with hardware drivers:  
 
  $ export EGL_DRIVER=/usr/lib/egl/egl_gallium.so
 
  $ export EGL_DRIVER=/usr/lib/egl/egl_gallium.so
 +
 +
It is possible to run Weston inside a running X session:
 +
$ weston
  
 
Then at a TTY you can run the demos. To launch a terminal emulator:
 
Then at a TTY you can run the demos. To launch a terminal emulator:
Line 50: Line 54:
 
  $ weston-view doc1.pdf doc2.pdf...
 
  $ weston-view doc1.pdf doc2.pdf...
  
== Qt ==
+
== GUI libraries ==
 
+
=== Installation ===
+
You need to build and install {{AUR|qt5}} from the [[AUR]], which contains QPA (Lighthouse) support.
+
 
+
=== Usage ===
+
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=/usr/lib/qt5/bin:$PATH
+
$ export LD_LIBRARY_PATH=/usr/lib/qt5/bin
+
$ qmake
+
$ make
+
 
+
And run it by executing the compiled binary:
+
$ export LD_LIBRARY_PATH=/usr/lib/qt5/bin
+
$ export QT_QPA_PLATFORM=waylandgl
+
$ ./binaryname
+
 
+
=== Qt Compositor ===
+
There is ongoing work to make [http://labs.qt.nokia.com/2011/03/18/multi-process-lighthouse/ Qt-Compositor], a base layer to make custom Qt compositors on top of Wayland.
+
 
+
== Other GUI libraries ==
+
 
([http://wayland.freedesktop.org/toolkits.html page from official website])
 
([http://wayland.freedesktop.org/toolkits.html page from official website])
  
 
===GTK+===
 
===GTK+===
  
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 <code>--enable-wayland</code> to configure:
+
You need to install {{pkg|gtk3}} from extra, which now has the Wayland backend enabled.
  
$ git clone git://git.gnome.org/gtk+
+
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.
$ 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 <code>GDK_BACKEND</code> environment variable to <code>wayland</code>.
 
When both Wayland and X backends are enabled, GTK+ will default to the X11 backend, but this can be overridden by setting the <code>GDK_BACKEND</code> environment variable to <code>wayland</code>.
  
{{Note|Alternatively, you can install {{AUR|gtk3-git}} from the [[AUR]].}}
+
===Qt5===
 +
 
 +
You need to install {{pkg|qt5-base}} and the wayland plugin - {{aur|qt5-qtwayland-git}}.
 +
 
 +
To run a Qt5 app with the Wayland plugin, set QT_QPA_PLATFORM=wayland-egl.
  
 
===Clutter===
 
===Clutter===
  
The Clutter toolkit has a Wayland backend that allows it to run as a Wayland client. The backend is in the master branch of the [http://git.gnome.org/browse/clutter main repo] and can be activated by passing <code>--with-flavour=wayland</code> to the configure script.
+
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, you need to set <code>CLUTTER_BACKEND</code> environment variable to <code>wayland</code>.
  
 
===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.
+
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.
 +
 
 +
To run a SDL application on Wayland, you need to set <code>SDL_VIDEODRIVER</code> environment variable to <code>wayland</code>.
  
 
===EFL===
 
===EFL===
Line 104: Line 91:
 
===KDE===
 
===KDE===
  
The KDE Wayland support is expected to come in three phases, with the first two phases expected to be completed this year during the KDE SC 4.8 and 4.9 development cycles. Please see [http://community.kde.org/KWin/Wayland here] for details.
+
KDE 4.11 beta supports starting [http://blog.martin-graesslin.com/blog/2013/06/starting-a-full-kde-plasma-session-in-wayland/ KWin under Wayland system compositor]. There is currently no support for using KWin as a session compositor.
 
+
Also, there is [http://blog.martin-graesslin.com/blog/2011/03/kwin-at-gsoc-2011/ early work] to make it possible to run KWin (KDE's window manager) on Wayland.
+
  
 
===GNOME===
 
===GNOME===
  
GNOME will be ported to Wayland in a future version.
+
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].
  
===Unity===
+
===Pure Wayland===
Ubuntu desktop shell Unity, using Compiz window manager, was [http://www.markshuttleworth.com/archives/551 announced] to be ported to Wayland.
+
 
 +
{{Warning|Some really quick notes on installing a pure (no X11) wayland system on Arch Linux. This is from source and installed into /usr/local. May break your system. You have been warned. (by elethiomel@gmail.com)}}
 +
 
 +
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 =====
 +
 
 +
$ pacman -S wayland libdrm pixman libxkbcommon
 +
 
 +
===== Mesa =====
 +
 
 +
$ git clone git://anongit.freedesktop.org/mesa/mesa
 +
$ cd mesa
 +
$ CFLAGS=-DMESA_EGL_NO_X11_HEADERS ./autogen.sh --prefix=/usr/local --enable-gles2 --disable-gallium-egl --with-egl-platforms=wayland,drm --enable-gbm --enable-shared-glapi --with-gallium-drivers=r300,r600,swrast,nouveau --disable-glx --disable-xlib
 +
$ make
 +
$ make install
 +
 
 +
===== cairo =====
 +
 
 +
Note - no glx/gl or xcb - EGL only.
 +
 
 +
$ pacman -S libpng
 +
$ git clone git://anongit.freedesktop.org/cairo
 +
$ cd cairo
 +
$ CFLAGS=-DMESA_EGL_NO_X11_HEADERS ./autogen.sh --prefix=/usr/local/  --disable-xcb  --enable-glesv2
 +
$ make
 +
$ make install
 +
 
 +
===== weston =====
 +
 
 +
$ git clone git://anongit.freedesktop.org/wayland/weston
 +
$ cd weston/
 +
$ CFLAGS="-DMESA_EGL_NO_X11_HEADERS" ./autogen.sh --prefix=/usr/local/ --with-cairo-glesv2 --disable-xwayland --disable-x11-compositor --disable-xwayland-test
 +
$ make
 +
$ make install
  
 
==See also==
 
==See also==

Revision as of 11:21, 28 June 2013

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. For more information on Wayland see its homepage.

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

Requirements

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

Installation

Wayland is most probably installed on your system already as it is an indirect dependency of gtk2 and gtk3. If it is not installed, you will find the wayland package in extra.

Usage

As Wayland is only a library, it is useless on its own. To use it, you need a compositor (like Weston), Weston demo applications, Qt5 with Wayland plugin, and/or GTK+ with Wayland support.

Weston

Installation

You need to install weston from community.

Usage

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

$ weston-launch
Note: You need to be in the video group for Weston to start; this command is not supposed to be run as root and doing that may freeze your VT.
Note: 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

It is possible to run Weston inside a running X session:

$ weston

Then at a TTY you can run the demos. To launch a terminal emulator:

$ weston-terminal

To move flowers around the screen:

$ weston-flower 

To test the frame protocol (runs glxgears):

$ weston-gears

To display images:

$ weston-image image1.jpg image2.jpg...

To display PDF Files:

$ weston-view doc1.pdf doc2.pdf...

GUI libraries

(page from official website)

GTK+

You need to install gtk3 from extra, which now has the Wayland backend enabled.

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.

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.

Qt5

You need to install qt5-base and the wayland plugin - qt5-qtwayland-gitAUR.

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, you need to set CLUTTER_BACKEND environment variable to wayland.

SDL

Benjamin Franzke is working on a port of SDL to Wayland, it's 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, you need to set SDL_VIDEODRIVER environment variable to wayland.

EFL

EFL has complete Wayland support. Please see here for details.

Window managers and desktop shells

KDE

KDE 4.11 beta supports starting KWin under Wayland system compositor. There is currently no support for using KWin as a session compositor.

GNOME

GNOME is currently ported to Wayland and will be available in a future version. For details look into the GNOME Wiki.

Pure Wayland

Warning: Some really quick notes on installing a pure (no X11) wayland system on Arch Linux. This is from source and installed into /usr/local. May break your system. You have been warned. (by elethiomel@gmail.com)

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
$ pacman -S wayland libdrm pixman libxkbcommon
Mesa
$ git clone git://anongit.freedesktop.org/mesa/mesa
$ cd mesa
$ CFLAGS=-DMESA_EGL_NO_X11_HEADERS ./autogen.sh --prefix=/usr/local --enable-gles2 --disable-gallium-egl --with-egl-platforms=wayland,drm --enable-gbm --enable-shared-glapi --with-gallium-drivers=r300,r600,swrast,nouveau --disable-glx --disable-xlib
$ make
$ make install
 
cairo

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

$ pacman -S libpng
$ git clone git://anongit.freedesktop.org/cairo
$ cd cairo
$ CFLAGS=-DMESA_EGL_NO_X11_HEADERS ./autogen.sh --prefix=/usr/local/  --disable-xcb  --enable-glesv2 
$ make
$ make install
weston
$ git clone git://anongit.freedesktop.org/wayland/weston
$ cd weston/
$ CFLAGS="-DMESA_EGL_NO_X11_HEADERS" ./autogen.sh --prefix=/usr/local/ --with-cairo-glesv2 --disable-xwayland --disable-x11-compositor --disable-xwayland-test
$ make
$ make install

See also

External links