KWin/Wayland: Difference between revisions

From KDE Community Wiki
No edit summary
Line 39: Line 39:


KWin starts the Wayland Server when OpenGL ES compositing is activated. After that you can start one of the Wayland demo clients. You can also start any Qt application with the Wayland Lighthouse build, but it's difficult to notice a difference to a normal X11 client.
KWin starts the Wayland Server when OpenGL ES compositing is activated. After that you can start one of the Wayland demo clients. You can also start any Qt application with the Wayland Lighthouse build, but it's difficult to notice a difference to a normal X11 client.
= Why not Mir =
The Mir project got announced while KWin was already being ported to Wayland. At that time it was not known whether Mir will succeed or not given that it was in very early development stage. Furthermore it was at that time only a solution for one downstream distribution. This made it unsuited to adjust the development plans. Given that the development continues to focus on Wayland. As long as Mir is a solution for only one downstream distribution the maintenance overhead of adding support is not justified.


= I found a bug, what should I do? =
= I found a bug, what should I do? =

Revision as of 13:25, 19 June 2013

What is Wayland?

Wayland is a small display server which is considered to have the chance to replace X11 as primary windowing system. But Wayland is not a direct successor of X and does not follow the design of X. The display server is directly moved into the Compositor (that is KWin) and clients connect to this server through a Unix socket.

Why Plasma needs Wayland?

X has some serious issues and is rather old. The protocol is designed for the usecases three decades ago. Over the last years more and more functionality has been moved from X either into the kernel or into the compositors. The X server is more or less only a proxy between kernel, compositor and the X clients.

Today the compositor does everything the X server used to do. There are some remaining features not yet moved into the compositor (e.g. input handling) but those would make most sense in the compositor. The best situation would be to let the compositor directly work together with the kernel for rendering and input handling and manage the clients directly, which means to remove the Proxy. This is what Wayland is about. More reasons for Wayland in the FAQ.

In Plasma we need Wayland support as we are hitting the limitations of X all the time. Wayland will simplify our architecture and allow us to composite the screen in the way we consider as most useful.

Wayland Support in Plasma

Wayland support in the KDE Plasma Workspaces is still in a pre-alpha state. The workspaces have been developed for X11 and much functionality relies on X11. To be able to make proper use of Wayland these bits have to be rewritten.

The most complex task is to implement Wayland support in KWin, KDE Plasma's Compositor and Window Manager. Since 4.11 KWin has some initial Wayland support. It is not yet able to manage Wayland Clients but can use another Wayland compositor as a rendering target instead of X. This is the beginning of a Wayland session compositor running on top of a Wayland system compositor. Instructions on how to test it can be found in this blog post.

Why not a new Compositor?

Given that KWin was designed as a X11 Window Manager and later as a X11 compositor the question is valid, why not to implement a new Wayland compositor from scratch. Most parts of KWin are X11 independent. E.g. the Desktop Effect system is able to integrate Wayland clients without any change, the same is true for Window Decorations and other parts.

Another reason is that the KWin development team does not have the manpower to maintain an independent X11 window manager and a Wayland compositor. Starting a new Wayland compositor would mean to stop the work on the X11 window manager, which would be a bad move as we cannot know yet whether Wayland will succeed and will be supported on all hardware. Also in future KDE will have to provide an X11 window manager.

KWin is known as one of the most feature complete and most stable window managers. More than a decade of development effort has gone into this Window Manager. Reaching feature parity in a new Wayland compositor seems hardly possible if rewritten from scratch.

Writing a new Wayland Compositor would require to rewrite the complete X11 workspace in one go. This includes not only the Window Manager, but also parts of Plasma, KDM, Screen Locker and many, many more. This would take a long development time and the transition would not be smooth, very likely buggy and with regressions like the 4.0 introduction. We do not want to break the desktop!

Building KWin with Wayland support

Follow the build instructions for Wayland. We assume that Wayland and the dependencies have been installed to $WLD. Now you can compile kde-workspace with Wayland support. Adjust the pkgconfig path to include $WLD/lib/pkgconfig. You need to have development headers for OpenGL ES and EGL around, you may use the ones of your Wayland build.

If everything works fine, cmake will tell that the optional build dependencies Wayland and OpenGL ES are found.

Starting KWin with Wayland

After compiling you can start KWin with Wayland support. Therefore you need to include the Wayland Server libraries in the LD_LIBRARY_PATH and point the LIBGL_DRIVERS_PATH to your self-compiled version of Mesa 7.11:

LD_LIBRARY_PATH=${WLD}/lib:${LD_LIBRARY_PATH} LIBGL_DRIVERS_PATH=${WLD}/lib/dri/ kwin --replace &

KWin starts the Wayland Server when OpenGL ES compositing is activated. After that you can start one of the Wayland demo clients. You can also start any Qt application with the Wayland Lighthouse build, but it's difficult to notice a difference to a normal X11 client.

Why not Mir

The Mir project got announced while KWin was already being ported to Wayland. At that time it was not known whether Mir will succeed or not given that it was in very early development stage. Furthermore it was at that time only a solution for one downstream distribution. This made it unsuited to adjust the development plans. Given that the development continues to focus on Wayland. As long as Mir is a solution for only one downstream distribution the maintenance overhead of adding support is not justified.

I found a bug, what should I do?

Open your text editor, fix it and open a review request on Review Board.

I want to help

Great, get in touch with us either through kwin at kde dot org or plasma dash devel at kde dot org or find us in #kwin or #plasma on freenode. There is lots to work on and we can use every helping hand.

More Information

  • Presentation on Desktop Summit 2011: Slides