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.
This commit is contained in:
Tor Hedin Brønner
2019-10-17 23:07:36 +02:00
parent 3f1b4a7b8f
commit c8dfaacb42
+9 -8
View File
@@ -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();
}
}