diff --git a/stackoverlay.js b/stackoverlay.js index f2a3b50..00f509e 100644 --- a/stackoverlay.js +++ b/stackoverlay.js @@ -223,6 +223,7 @@ var StackOverlay = class StackOverlay { if ("_previewId" in this) return; this._previewId = Mainloop.timeout_add(100, () => { + delete this._previewId; if (this.clone) { this.clone.destroy(); this.clone = null; @@ -246,6 +247,8 @@ var StackOverlay = class StackOverlay { x = monitor.x; clone.set_position(x, y); }); + + this._removeId = Mainloop.timeout_add_seconds(2, this.removePreview.bind(this)); } removePreview() { @@ -253,6 +256,10 @@ var StackOverlay = class StackOverlay { Mainloop.source_remove(this._previewId); delete this._previewId; } + if ("_removeId" in this) { + Mainloop.source_remove(this._removeId); + delete this._removeId; + } if (!this.clone) return;