Skip to content

clutter/offscreen-effect: Don't clear fb when disabling effect mid-paint

Since bf594e9f we're listening to the "notify::enabled" signal to clear the offscreen framebuffer in case the effect gets disabled.

Now it's possible an offscreen effect gets disabled while painting the actor using clutter_actor_continue_paint(), which is called by ClutterEffect after invoking the pre_paint() vfunc but before invoking the post_paint() vfunc. That means priv->offscreen will be NULL when post_paint() is called and we never pop the matrix nor the framebuffer we pushed before.

To fix this, in case the actor is currently being painted and we receive the "notify::enabled" signal, keep the offscreen framebuffer around until the post_paint() vfunc is invoked, pop the matrix and our framebuffer from the stacks, paint the image that got rendered to that framebuffer and then finally clear it.

Fixes gnome-shell#2489 (closed)

Merge request reports