From 7a488ccc7b9035e04da24c974ebd3631fea34eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Sun, 27 Oct 2019 14:40:18 +0100 Subject: [PATCH] fixup! cycleWindowWidth: Remember and prefer the originial position --- tiling.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tiling.js b/tiling.js index fa64cab..dbe35d2 100644 --- a/tiling.js +++ b/tiling.js @@ -2583,6 +2583,10 @@ function toggleMaximizeHorizontally(metaWindow) { function cycleWindowWidth(metaWindow, space, {context} = {}) { let steps = prefs.cycle_width_steps; + // Remember the original position + if (context.targetX === undefined) + context.targetX = space.targetX; + let frame = metaWindow.get_frame_rect(); let monitor = Main.layoutManager.monitors[metaWindow.get_monitor()]; let workArea = space.workArea(); @@ -2605,7 +2609,6 @@ function cycleWindowWidth(metaWindow, space, {context} = {}) { targetX = workArea.x + workArea.width - minimumMargin() - targetWidth; } } else { - context.targetX = context.targetX || space.targetX; if (space.targetX + space.cloneContainer.width === space.width) { space.targetX -= targetWidth - frame.width; } else {