From 9d3f38233aa3733621dc040c32e57e2fdf97f442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Sat, 5 Oct 2019 12:16:29 +0200 Subject: [PATCH] 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. --- tiling.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tiling.js b/tiling.js index 2677dc7..5a7be3e 100644 --- a/tiling.js +++ b/tiling.js @@ -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); } }