mirror of
https://github.com/gosticks/PaperWM.git
synced 2026-12-04 04:11:38 +00:00
edge previews: remove after timeout
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user