Problems in KWayland causes by API and ABI compatibility promises

Vlad Zahorodnii vlad.zahorodnii at kde.org
Thu Mar 5 12:21:01 GMT 2020


Hi,

KWayland is a library that provides convenience wrappers for Wayland 
protocols. Usually, when we want to implement some Wayland protocol, 
first, we add corresponding wrappers in KWayland and after that we 
actually implement the protocol in KWin.

Unfortunately, we made a bad design choice in KWayland. It is common in 
KWayland to see abstractions over unstable protocols. We do it in the 
name of "don't repeat yourself" principle. This reduces the amount of 
duplicated code in KWin, but it also makes much more difficult to extend 
KWayland. Abstracting unstable protocols turns out to be really bad when 
the next version of an unstable protocol contains big changes, e.g. 
xdg-shell-unstable-v5 -> xdg-shell-unstable-v6. Due to the API and ABI 
compatibility promises, we can't fix the broken design of those 
wrappers. We should not try to abstract over Wayland protocols in the 
first place!

We need to fix those wrappers in order to implement the corresponding 
protocols properly in KWin (and fix a few bugs).

One option is to make KWayland unstable so we are free to do necessary 
changes to fix the wrappers, but it doesn't really go along with the 
Frameworks' policies. Another option is to move KWayland somewhere else, 
e.g. KWin or Plasma.

Alternatively, we could provide new wrappers and append a suffix to 
class names, e.g. "2" or "V2". But I don't like this approach for a 
couple of reasons. First, we are going to mix two types of versions in a 
single class name, e.g. XdgToplevelV6InterfaceV2, etc. Second, some 
protocols are not completely implemented in KWin, so we may still need 
to change wrappers in a way that may break API or ABI compatibility. 
Arguably, we just don't have to push semi-finished changes, but 
implementing everything all at once is a bit difficult and tackling one 
problem at a time is much easier.

I'm writing this email to bring problems that we currently have in 
KWayland up to discussion and find the way in which we can address them.

For what it's worth the question of moving KWayland out of Frameworks to 
somewhere else had been raised before, but the discussion got stalled... 
sort of. [1]

Cheers,
Vlad

[1] https://phabricator.kde.org/T11903


More information about the Kde-frameworks-devel mailing list