🔧 Remove old shader if a new one is to be applied

This commit is contained in:
Simon Schneegans
2022-05-11 04:57:07 +02:00
parent 78679ef139
commit 3175c289b5
+12 -8
View File
@@ -365,12 +365,13 @@ class Extension {
return;
}
// There is the weird case where an animation is already ongoing and then a
// window-open animation is requested. This happens when a window is closed which has
// been created before the session was started (e.g. when GNOME Shell has been
// restarted in the meantime). We do nothing in this case.
if (forOpening && actor.get_effect('burn-my-windows-effect')) {
return;
// There is the weird case where an animation is already. This happens when a window
// is closed which has been created before the session was started (e.g. when GNOME
// Shell has been restarted in the meantime).
const oldShader = actor.get_effect('burn-my-windows-effect');
if (oldShader) {
actor.remove_effect(oldShader);
oldShader.free();
}
// ------------------------------------------------------------------ choose an effect
@@ -499,8 +500,11 @@ class Extension {
// Remove the effect if the animation finished or was interrupted.
if (forOpening) {
transition.connect('stopped', () => {
actor.remove_effect_by_name('burn-my-windows-effect');
shader.free();
const oldShader = actor.get_effect('burn-my-windows-effect');
if (oldShader) {
actor.remove_effect(oldShader);
oldShader.free();
}
});
}
}