From da04d5526ac871dfdfe475ea352e87a675987e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Br=C3=B8nner?= Date: Sun, 11 Nov 2018 16:19:03 +0100 Subject: [PATCH] Bugfix: Space.targetX was sometimes set to null space.targetX = Math.round(clone.targetX) + ... resulted in null when clone.targetX was undefined. This could happend on extension startup and caused the space to be unusable. Initialize clone.targetX and remove duplicated space.targetX initialization. --- tiling.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tiling.js b/tiling.js index 8246f1c..d5df87b 100644 --- a/tiling.js +++ b/tiling.js @@ -205,8 +205,6 @@ class Space extends Array { this.targetX = 0; if (oldSpace) { monitor = Main.layoutManager.monitors[oldSpace.monitor.index]; - this.targetX = oldSpace.targetX; - cloneContainer.x = this.targetX; } this.setMonitor(monitor, false); @@ -234,6 +232,7 @@ 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 => { @@ -1469,6 +1468,7 @@ function registerWindow(metaWindow) { layout_manager: new WindowCloneLayout() }); container.add_actor(clone); + container.targetX = 0; clone.meta_window = metaWindow; metaWindow.clone = container;