Skip to content

Import kwaylandserver

From #57 (closed):

kwayland-server provides a set of Qt friendly wrappers around wayland protocol interfaces. However, those wrappers can't simply exist in vacuum. We work around that by adding various callback mechanism, which makes everything more complex than it has to be. Besides that, there's a strong connection between kwin and kwayland-server. If kwayland-server changes, kwin will mostly have to. This makes git bisecting really painful!

But perhaps the main problem is that having wrappers in a separate library adds more work and it solves hypothetical problems. Besides implementing the wayland protocol, one would need to decide what api to expose to the compositor and then implement the protocol in the compositor. Originally, the purpose of kwayland-server was to fill the gap between libwayland and the compositor. However, we've switched to qtwaylandscanner, which took over the responsibility of filling that gap.

As the experience shows, many people wishing to write a compositor for their specific usecase are not keen about implementing a drm backend, a scene graph, etc. They most likely going to take an existing compositor and tweak to it to meet their needs. Also, why would you want to use kwayland-server and waste a lot of money implementing other missing components if there are other wayland compositor libraries that provide more?

As we decided earlier this year, it's worth bringing wayland server code back to kwin. Relevant kwin mailing list discussion: https://mail.kde.org/pipermail/kwin/2021-May/005220.html

How this MR was created

This change was created in two steps:

  1. Prepare kwayland-server repo: I ran a few git filter-repo commands to re-write git history in order to get file system in the desired shape
  2. Merge kwayland-server repo using the git-merge-repo script from kde-dev-scripts repo (that's commit "Import kwaylandserver"). On top of that, I added another commit "Integrate kwaylandserver" in order to make kwin use in-tree copy of kwaylandserver.

Next steps

  • Get this merged

  • Some leftovers from KWaylandServer have been left, in particular the KWaylandServer namespace. This is going to be changed - KWaylandServer classes will be renamed and moved into KWin namespace in a follow up MR.

  • Simplify some wayland protocol implementations by making KWaylandServer code utilize KWin's platform abstractions directly and also fix a few known bugs, etc.

Merge plan

closes #57 (closed)

Edited by Vlad Zahorodnii

Merge request reports