appDisplay: Use ::paint handler to set up spring animation
The animation needs the icons' final positions, so we currently defer it to a ::notify::allocation handler; however as starting the animation during an allocation cycle would trigger a Clutter warning, it is further deferred to a MetaLater. While this usually works, it is possible that the allocation is already valid when we connect the signal, in which case the animation is triggered at a later unexpected time. Switch to a more robust ::paint handler instead, which also allows us to get rid of the double-delay. https://bugzilla.gnome.org/show_bug.cgi?id=736148
This commit is contained in:
parent
6c9a7ce84e
commit
c67eabaf62
@ -219,17 +219,10 @@ var BaseAppView = new Lang.Class({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (animationDirection == IconGrid.AnimationDirection.IN) {
|
if (animationDirection == IconGrid.AnimationDirection.IN) {
|
||||||
let toAnimate = this._grid.actor.connect('notify::allocation', Lang.bind(this,
|
let id = this._grid.actor.connect('paint', () => {
|
||||||
function() {
|
this._grid.actor.disconnect(id);
|
||||||
this._grid.actor.disconnect(toAnimate);
|
this._doSpringAnimation(animationDirection);
|
||||||
// We need to hide the grid temporary to not flash it
|
});
|
||||||
// for a frame
|
|
||||||
this._grid.actor.opacity = 0;
|
|
||||||
Meta.later_add(Meta.LaterType.BEFORE_REDRAW,
|
|
||||||
Lang.bind(this, function() {
|
|
||||||
this._doSpringAnimation(animationDirection)
|
|
||||||
}));
|
|
||||||
}));
|
|
||||||
} else {
|
} else {
|
||||||
this._doSpringAnimation(animationDirection);
|
this._doSpringAnimation(animationDirection);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user