Render and Display backends based on wlroots
We currently implement several display backends ourselves for our Wayland session. These "Platform" called plugins are:
- Wayland nested
- X11 nested
The Wayland compositor library wlroots provides the relevant ones of these as backend components too. The idea is to replace our own implementations with the wlroots backend components.
- Removes a lot of code directly talking with kernel, X11 and other Wayland servers as client.
- Profit from already implemented and upcoming features implemented upstream in wlroots, for example VRR now and in the future libliftoff.
- More shared code with other compositor projects based on wlroots, less fragmentation in Wayland ecosystem.
While the display backends itself are well encapsulated as the Platform plugins, there is integration with the Scene plugins as part of the render pipeline. Additionally there is some integration with logind for the DRM plugin (to become the DRM master).
On Wayland we provide two ways to render: via OpenGl or QPainter, loaded as plugins at runtime.
There is then additional integration code for these plugins with the Platform/display backends in the platformsupport/scenes directory, which is inherited by implementing classes in the Platform backends.
Q: Can we reuse some of that infrastructure for backends based on wlroots or do we need to build up a parallel one?
Q: Can we continue to provide a QPainter render mode with wlroots?
Q: When the DRM backend is based on wlroots, should we use its session management code instead of our own?
A: Highly likely.
wlroots uses the libwayland-server event loop. In KWinFT that is encapsulated by Wrapland. My plan would be:
- Expose Wrapland's libwayland event loop to wlroots and handle its events somehow in KWinFT.
- Long-term provide our own event loop instead of running the main event loop of QGuiApplication. Instead handle Qt events in this loop via QCoreApplication::processEvents
Q: Instead of following these two steps, should we directly start with creating our own event loop?