iconGrid: Avoid animating the same icon twice

If the icon proper has opacity of zero then that's probably because a
clone of it is animating. So avoid animating the source actor too.

And if there's any other reason for the opacity being zero, still don't
animate it because we can't see it :)

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/2167
This commit is contained in:
Daniel van Vugt 2020-02-07 17:23:11 +08:00 committed by Florian Müllner
parent 33ae220ad2
commit b5651e38c7

View File

@ -195,7 +195,7 @@ function zoomOutActorAtPos(actor, x, y) {
}
function animateIconPosition(icon, box, flags, nChangedIcons) {
if (!icon.has_allocation() || icon.allocation.equal(box)) {
if (!icon.has_allocation() || icon.allocation.equal(box) || icon.opacity === 0) {
icon.allocate(box, flags);
return false;
}