edge previews: remove after timeout

This commit is contained in:
Tor Hedin Brønner
2019-11-13 15:38:27 +01:00
parent 788c328155
commit 697f025c55
+7
View File
@@ -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;