js: Use implicit animations for animatable properties
We now have everything in place to replace Tweener for all animatable properties with implicit animations, which has the following benefits: - they run entirely in C, while Tweener requires context switches to JS each frame - they are more reliable, as Tweener only detects when an animation is overwritten with another Tween, while Clutter considers any property change https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22
This commit is contained in:
@ -133,10 +133,11 @@ var OsdWindow = class {
|
||||
this.actor.opacity = 0;
|
||||
this.actor.get_parent().set_child_above_sibling(this.actor, null);
|
||||
|
||||
Tweener.addTween(this.actor,
|
||||
{ opacity: 255,
|
||||
time: FADE_TIME / 1000,
|
||||
transition: 'easeOutQuad' });
|
||||
this.actor.ease({
|
||||
opacity: 255,
|
||||
duration: FADE_TIME,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD
|
||||
});
|
||||
}
|
||||
|
||||
if (this._hideTimeoutId)
|
||||
@ -156,15 +157,15 @@ var OsdWindow = class {
|
||||
|
||||
_hide() {
|
||||
this._hideTimeoutId = 0;
|
||||
Tweener.addTween(this.actor,
|
||||
{ opacity: 0,
|
||||
time: FADE_TIME / 1000,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: () => {
|
||||
this._reset();
|
||||
Meta.enable_unredirect_for_display(global.display);
|
||||
}
|
||||
});
|
||||
this.actor.ease({
|
||||
opacity: 0,
|
||||
duration: FADE_TIME,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||
onComplete: () => {
|
||||
this._reset();
|
||||
Meta.enable_unredirect_for_display(global.display);
|
||||
}
|
||||
});
|
||||
return GLib.SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user