From c8dfaacb4292f4dfea25fa3497d6920e6c59af0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Thu, 17 Oct 2019 22:58:45 +0200 Subject: [PATCH] layout: Do not run any auto corrections when grabbing NOTE: `animate` is false when grabbing. In general auto will cause an animate so we disable it in the somewhat more general case. --- tiling.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tiling.js b/tiling.js index 82ccf9e..cf86ef1 100644 --- a/tiling.js +++ b/tiling.js @@ -453,7 +453,7 @@ class Space extends Array { let width = Math.max(1, x - gap); this.cloneContainer.width = width; - if (auto) { + if (auto && animate) { if (width < workArea.width) { this.targetX = min + Math.round((workArea.width - width)/2); } else if (this.targetX + width < min + workArea.width) { @@ -461,14 +461,15 @@ class Space extends Array { } else if (this.targetX > workArea.min ) { this.targetX = workArea.x; } - } - Tweener.addTween(this.cloneContainer, - { x: this.targetX, - time, - onComplete: this.moveDone.bind(this) - }); - if (animate) { + Tweener.addTween(this.cloneContainer, + { x: this.targetX, + time, + onComplete: this.moveDone.bind(this) + }); + } else if (animate) { ensureViewport(this.selectedWindow, this); + } else { + this.moveDone(); } }