From cd874e4d21b0ee593f02e54ec7ae5f976fe14f26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Br=C3=B8nner?= Date: Sun, 24 Jun 2018 15:09:58 +0200 Subject: [PATCH] Fix centerWindowHorizontally for vertically tiled windows When centering a v-tiled window other than the top window, move_to squashed the column since fixColumn started at the focus window's y It's no fully clear what the `y` argument in `move_to` should do maybe? After this fix is doesn't really do anything. --- tiling.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tiling.js b/tiling.js index 331a852..890ea98 100644 --- a/tiling.js +++ b/tiling.js @@ -1111,7 +1111,9 @@ function move_to(space, meta_window, { x, y, delay, transition, let index = space.indexOf(meta_window); if (index === -1) return; - fixColumn(space, index, x, y, onComplete); + + const columnTop = panelBox.height + prefs.vertical_margin; + fixColumn(space, index, x, columnTop, onComplete); let frame = meta_window.get_frame_rect(); @@ -1122,8 +1124,7 @@ function move_to(space, meta_window, { x, y, delay, transition, for (let X = x + frame.width + gap, targetSet = false, n=index+1 ; n < space.length; n++) { - let width = fixColumn(space, n, X, - panelBox.height + prefs.vertical_margin); + let width = fixColumn(space, n, X, columnTop); if (!targetSet && X + width > space.width) { let mru = global.display.get_tab_list(Meta.TabList.NORMAL, space.workspace); @@ -1140,7 +1141,7 @@ function move_to(space, meta_window, { x, y, delay, transition, n=index-1; n >= 0; n--) { let width = Math.max(...space[n].map(w => w.get_frame_rect().width)); X -= gap + width; - fixColumn(space, n, X, panelBox.height + prefs.vertical_margin); + fixColumn(space, n, X, columnTop); if (!targetSet && X < 0) { let mru = global.display.get_tab_list(Meta.TabList.NORMAL,