Wayland

This page collects information about porting GNOME to work with Wayland instead of X.

What is Wayland ?

Wayland is a compositor protocol and library implementation of that protocol.

Under Wayland, the roles of the display manager and the compositor are merged. The compositor uses Linux APIs such as KMS and evdev directly, and EGL is used for rendering. The core Wayland protocol is fairly minimal, and a lot of functionality is offered via extensions that implement interfaces (similar to D-Bus interfaces).

See the Wayland website for more in-depth information.

Why switch to Wayland ?

X is showing its age - it has been kept alive for a very long time by means of adding more and more extensions to the core protocol. The Wayland protocol is a much leaner definition of a modern compositing-based display system. We don't need to carry around many obsolete parts of the X protocol (such as core fonts, the core rendering API, etc) any longer. Some problematic parts of the X protocol, such as grabs, are simply not present under Wayland, which avoids a whole class of problems.

Wayland enables features that are hard or impossible to support under X:

  • input transformation
  • transparent hardware overlays
  • direct rendering
  • isolating clients (sandboxing)
  • makes it possible to reuse android drivers (https://github.com/libhybris/libhybris)

  • per-crtc EGLSurfaces means repainting and swapping only the monitor where content changes
  • smooth transition between composited desktop and fullscreen clients (no X unredirect flicker)
  • eliminates lag between cursor and dragged windows (eg moving toplevels or dnd icons)
  • better remote display
  • ...

Many core X contributors are eager to see us move to the next generation display system - after all Wayland was born and raised in the X community, and has strong support there.

Drivers

The driver situation for Wayland is as follows:

X compatibility

X clients are still supported under Wayland via a 'rootless' X server that translates X windows into Wayland surfaces. xwayland is such an X server.

Cross-desktop compatibility

For X-based desktops, the ICCCM and EWMH specifications (together with a number of other X and freedesktop specifications) have provided a reasonable basis for interoperability of applications across different environments.

The Wayland reference compositor, weston, has served as a testbed to implement interfaces that replace some of these specifications. gnome-shell as a Wayland compositor will implement these interfaces, and the GTK+ Wayland backend will use them.

We will work with the Wayland community and with other desktops that are moving towards Wayland (such as KDE and Enlightenment) to expand these interfaces as needed and document them well enough to ensure interoperability.

What others are doing

KDE currently has no plans to stop X from fully working, and the idea is to support Wayland as an optional alternative. More information about the Wayland support in KDE can be found here: http://community.kde.org/KWin/Wayland and here: http://vizzzion.org/blog/2013/01/the-road-to-kde-frameworks-5-and-plasma-2/

The Enlightenment project is backing Wayland and is working towards making Enlightenment a Wayland compositor. The EFL toolkit is already ported to Wayland. Statement here: https://phab.enlightenment.org/phame/live/1/post/enlightenment_and_efl_backing_wayland/

Canonical has announced that they were abandoning their earlier plans to use Unity + Mir, and instead plan to leverage Gnome + Wayland by default as of Ubuntu 18.04 LTS.

What does this mean for distributions?

Whether GNOME uses X or Wayland underneath should not affect a full Linux distribution in a majorly disruptive way.

The Wayland libraries will become GNOME dependencies, and need to be available.

The display manager will need to know how to launch a Wayland-based session in addition to launching X-based sessions, and a few other plumbing components (such as logind or ConsoleKit) will have to learn about this new type of session. For gdm, this will be part of the GNOME porting effort.

3rd party applications will continue to work in GNOME, via xwayland.

GNOME applications will continue to work in X-based environments, via the GTK+ X backend.

Porting GNOME to Wayland

Making GNOME work on Wayland can happen in several independent steps:

Proposed roadmap

  • GNOME 3.10 (Sep 2013)
    • X will still be the default
    • GNOME shell can operate as a Wayland compositor and allow experimentation and development in this mode; it should support the same core interfaces as Weston
    • GTK+ backend is functional enough for day-to-day use
    • Not all parts of the desktop will be ported over (e.g. display configuration, a11y, Wacom tablet support)
    • Applications will transparently fall back to using xwayland, if they don't work with Wayland yet
  • Summer or fall 2013: a GNOME/Wayland hackfest to make focused progress (see Hackfests/WaylandHackfest2012 for an earlier plan that sadly wasn't realized)

  • GNOME 3.12 (Mar 2014)
    • Most parts of GNOME will still work under X (some parts may be hard to keep working under both X and Wayland)
    • Display configuration
    • Many core GNOME applications work with Wayland
  • GNOME 3.14 (Sep 2014)
    • Day-to-day usable experience under Wayland
    • Keyboard layout supported
    • Drag-and-Drop supported
    • Touch supported
    • All core GNOME applications work with Wayland (see Applications)

  • GNOME 3.16
    • Input configuration
    • Wacom support
    • mixed-monitor HiDPI support
    • Polish and stability
    • Close Wayland protocol gaps (attached dialogs, drag cancellation, etc)
    • Complete port of GNOME to Wayland

Trying it out

Initial instructions for building from source and running

References

Initiatives/Wayland (last edited 2017-05-12 12:45:37 by SebastienDeleuze)