KWin/Wayland: Difference between revisions

From KDE Community Wiki
No edit summary
m (fix url to kde-workspace project)
Line 14: Line 14:
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.
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. Work has already started and can be found in the git branch "kwin-wayland" in the [https://projects.kde.org/projects/kde/kdebase/kde-workspace kde-workspace repository]. The support is very limited, at the moment (June 2011) it is possible to composite Wayland clients without being able to interact with the clients.
The most complex task is to implement Wayland support in KWin, KDE Plasma's Compositor and Window Manager. Work has already started and can be found in the git branch "kwin-wayland" in the [https://projects.kde.org/projects/kde/kde-workspace kde-workspace repository]. The support is very limited, at the moment (June 2011) it is possible to composite Wayland clients without being able to interact with the clients.


= Why not a new Compositor? =
= Why not a new Compositor? =

Revision as of 16:35, 19 September 2011

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. Work has already started and can be found in the git branch "kwin-wayland" in the kde-workspace repository. The support is very limited, at the moment (June 2011) it is possible to composite Wayland clients without being able to interact with the clients.

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. Therefore checkout the branch "kwin-wayland". Adjust the pkgconfig path to include $WLD/lib/pkgconfig and enable building KWin for GLES/EGL through cmake variable KWIN_BUILD_WITH_OPENGLES. 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 "Compiling KWin with Wayland support".

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.

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