Skip to content

Commit 91dfbd0

Browse files
committed
Fix a bug that had more than one scale transition. On complete, the
first to complete nulls the icon, and following ones access a null icon.
1 parent 2b61fb4 commit 91dfbd0

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

src/preview.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -392,20 +392,25 @@ export const Preview = GObject.registerClass({
392392
}
393393

394394
if (this.switcher._iconScaleUpDown) {
395-
this.switcher._manager.platform.tween(this._icon, {
396-
transition: 'easeInOutQuint',
397-
scale_x: 0,
398-
scale_y: 0,
399-
time: animation_time,
400-
onComplete: () => {
401-
if (this._icon !== null) {
402-
this._icon.destroy()
403-
this._icon = null;
404-
this._application_icon_box.destroy();
405-
this._application_icon_box = null;
406-
}
407-
},
408-
});
395+
if (this._icon !== null) {
396+
let t = this._icon.get_transition('scale-x');
397+
if (!t || t.get_interval().peek_final_value() !== 0) {
398+
this.switcher._manager.platform.tween(this._icon, {
399+
transition: 'easeInOutQuint',
400+
scale_x: 0,
401+
scale_y: 0,
402+
time: animation_time,
403+
onComplete: () => {
404+
if (this._icon !== null) {
405+
this._icon.destroy()
406+
this._icon = null;
407+
this._application_icon_box.destroy();
408+
this._application_icon_box = null;
409+
}
410+
},
411+
});
412+
}
413+
}
409414
}
410415
}
411416
}

0 commit comments

Comments
 (0)