libkwineffects: Synchronize EffectsHandler::windowAdded with Workspace::windowAdded

Merged Vlad Zahorodnii requested to merge work/zzag/window-animation-prepaint into master

This will ensure that the window animation is advanced only if the window is painted. I'd like to rely on this to allow effects schedule animations as soon as Workspace::windowAdded signal is emitted.

As is, the issue with delaying EffectsHandler::windowAdded is that we don't filter out all "not ready" windows, which breaks some effects because EffectWindows are leaked in some properties but no EffectsHandler::windowRemoved signal is emitted so those effects can perform cleanup. Fixing that by the means of ensuring that only renderable EffectWindows are exposed is hard too, and it would also mean that effects need to use their own api, which I would like to avoid and port the effects to kwin core apis instead.

This change makes the EffectsHandler emit the windowAdded signal as soon as the Workspace::windowAdded signal is received and minimize the difference between the states observed in kwin core and effects.

Merge request reports