Skip to content

wayland: Make some animations less glitchy

Vlad Zahorodnii requested to merge work/wayland-animation-effect-fix into master

If a minimized window is animated by the AnimationEffect, the final layer repaint will be ineffective. In order to account for that, the AnimationEffect adds the layer repaint to data.paint in the prePaintScreen() hook. The issue with this hack is that it does not work on Wayland with per screen rendering.

If a window is animated on screen B, but the layer repaint is added to data.paint when screen A is painted, there will be a ghost of the window on screen B.

In order to fix this issue, we need to use effects->addRepaint(), but we cannot use it in prePaintScreen() as it won't have immediate effect.

effects->addRepaint() can be called either from window paint hooks or from the postPaintScreen() hook. This change goes after the latter option.

In the prePaintScreen() hook, AnimationEffect will only advance animations. In the postPaintScreen() function, it will perform final janitorial chore.

Merge request reports

Loading