When changing global settings like switching between light and dark themes the result is currently quite messy. Apps update in a scattered order and a jarring change.
The solution is heavily inspired (copied) from Gnome, we cache the window for X milliseconds, then perform a crossfade between the cache and current contents.
It does mean any video is paused for half a second, but pragmatically it's not really bothersome. We know the user is primarily interacting with system settings at this point in time.
On receipt of an explicit DBus method call we create a cache and start animating. The explicit method call is needed so that we can guarantee kwin has a fully copy before a client might change.
Use of an offscreen texture is used so that we include any window decorations. The DeformEffect effect is repurposed as it has most the relevant logic if we remove the live updating.
Video taken with the obvious one liner in p-w
In the future this could also do QStyle changes / decoration changes / anything. The kwin side is very agnostic - though we have an issue that some changes cause kwin to restart effects.