x11: fix unreactive floats on empty workspaces

Make sure space.targetX is synced, if it isn't moveDone won't get the chance to
remove the background tracker, which steals all mouse clicks.
This commit is contained in:
Tor Hedin Brønner
2019-10-12 13:50:58 +02:00
parent 7dbe882753
commit 9d3f38233a
+5 -6
View File
@@ -228,7 +228,6 @@ class Space extends Array {
// Though, targetX shouldn't ideally be able to get into this state.
if (oldSpace && Number.isFinite(oldSpace.targetX)) {
this.targetX = oldSpace.targetX;
this.cloneContainer.x = this.targetX;
}
this.cloneContainer.x = this.targetX;
this.getWindows().forEach(w => {
@@ -437,12 +436,12 @@ class Space extends Array {
if (width < workArea.width) {
this.targetX = workArea.x - this.monitor.x + Math.round((workArea.width - width)/2);
}
Tweener.addTween(this.cloneContainer,
{ x: this.targetX,
time,
onComplete: this.moveDone.bind(this)
});
if (animate) {
Tweener.addTween(this.cloneContainer,
{ x: this.targetX,
time: prefs.animation_time,
onComplete: this.moveDone.bind(this)
});
ensureViewport(this.selectedWindow, this);
}
}