🎉 Add end-animation signal
This commit is contained in:
@@ -1,5 +1,13 @@
|
|||||||
# Changelog of the Burn-My-Windows Extension
|
# Changelog of the Burn-My-Windows Extension
|
||||||
|
|
||||||
|
## [Burn My Windows 19](https://github.com/schneegans/Burn-My-Windows/releases/tag/v19)
|
||||||
|
|
||||||
|
**Release Date:** TBD
|
||||||
|
|
||||||
|
#### Enhancements
|
||||||
|
|
||||||
|
* On GNOME, effects can now execute code whenever an animation ended. This is useful for cleaning up resources.
|
||||||
|
|
||||||
## [Burn My Windows 18](https://github.com/schneegans/Burn-My-Windows/releases/tag/v18)
|
## [Burn My Windows 18](https://github.com/schneegans/Burn-My-Windows/releases/tag/v18)
|
||||||
|
|
||||||
**Release Date:** 2022-06-30
|
**Release Date:** 2022-06-30
|
||||||
|
|||||||
@@ -229,6 +229,7 @@ class Extension {
|
|||||||
const shader = actor.get_effect('burn-my-windows-effect');
|
const shader = actor.get_effect('burn-my-windows-effect');
|
||||||
if (shader) {
|
if (shader) {
|
||||||
actor.remove_effect(shader);
|
actor.remove_effect(shader);
|
||||||
|
shader.endAnimation();
|
||||||
shader.returnToFactory();
|
shader.returnToFactory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -385,6 +386,7 @@ class Extension {
|
|||||||
const oldShader = actor.get_effect('burn-my-windows-effect');
|
const oldShader = actor.get_effect('burn-my-windows-effect');
|
||||||
if (oldShader) {
|
if (oldShader) {
|
||||||
actor.remove_effect(oldShader);
|
actor.remove_effect(oldShader);
|
||||||
|
oldShader.endAnimation();
|
||||||
oldShader.returnToFactory();
|
oldShader.returnToFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -520,6 +522,7 @@ class Extension {
|
|||||||
const oldShader = actor.get_effect('burn-my-windows-effect');
|
const oldShader = actor.get_effect('burn-my-windows-effect');
|
||||||
if (oldShader) {
|
if (oldShader) {
|
||||||
actor.remove_effect(oldShader);
|
actor.remove_effect(oldShader);
|
||||||
|
oldShader.endAnimation();
|
||||||
oldShader.returnToFactory();
|
oldShader.returnToFactory();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
+8
-1
@@ -48,7 +48,8 @@ var Shader = GObject.registerClass(
|
|||||||
Signals: {
|
Signals: {
|
||||||
'begin-animation':
|
'begin-animation':
|
||||||
{param_types: [Gio.Settings.$gtype, GObject.TYPE_BOOLEAN, Clutter.Actor.$gtype]},
|
{param_types: [Gio.Settings.$gtype, GObject.TYPE_BOOLEAN, Clutter.Actor.$gtype]},
|
||||||
'update-animation': {param_types: [GObject.TYPE_DOUBLE]}
|
'update-animation': {param_types: [GObject.TYPE_DOUBLE]},
|
||||||
|
'end-animation': {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
class Shader extends Shell.GLSLEffect { // --------------------------------------------
|
class Shader extends Shell.GLSLEffect { // --------------------------------------------
|
||||||
@@ -99,6 +100,12 @@ var Shader = GObject.registerClass(
|
|||||||
this._progress = progress;
|
this._progress = progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This will just emit the end-animation signal. It can be used to clean up any
|
||||||
|
// resources required during the animation.
|
||||||
|
endAnimation() {
|
||||||
|
this.emit('end-animation');
|
||||||
|
}
|
||||||
|
|
||||||
// This is called by the constructor. This means, it's only called when the
|
// This is called by the constructor. This means, it's only called when the
|
||||||
// effect is used for the first time.
|
// effect is used for the first time.
|
||||||
vfunc_build_pipeline() {
|
vfunc_build_pipeline() {
|
||||||
|
|||||||
Reference in New Issue
Block a user