Asynchronous decoration updates on Wayland
Currently, kwin processes decoration updates in synchronous fashion, which fires back when the client performs late initialization (even though it's weird, from spec perspective, it sort of okay-ish). kwin_wayland has to properly handle such cases.
Ideally, kwin should create or destroy the server-side decoration on the next surface commit or if the relevant configure event is acknowledged. The problem is that kwin would need to know the future size of decoration borders. KDecoration2 doesn't make it any easy. It allows to specify borders per window, etc.
There are several options:
(a) Break API compatibility and require decoration plugins to announce border sizes beforehand so kwin can know what border size to use for the next configure event
(b) Create a decoration object, but don't render it yet, and use it to query the border size when sending the next configure event. On the next surface commit, apply the decoration
(c) Create a decoration object when the xdg-decoration extension is installed and let kwin control the current decoration state. The decoration would need to ask kwin to make a state change. This gives kwin the most flexibility, but it's also somewhat complex solution
- kwayland-server merge request: kwayland-server!155 (merged)
- kwin merge request: !646 (closed)