From 697f025c55491a0b351e50fc7fc5231d4aaa1484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Wed, 13 Nov 2019 15:32:11 +0100 Subject: [PATCH] edge previews: remove after timeout --- stackoverlay.js | 7 +++++++ 1 file changed, 7 insertions(+) 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;