From d5d7c97767b9bc8b0dab4e2fb22c8103e0e6c06e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Wed, 6 Sep 2017 23:19:45 +0200 Subject: [PATCH] Fix propogate_backward Used the width of the wrong window to calculate the position, and called propogata forward instead (duh). --- tiling.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tiling.js b/tiling.js index a61e3ed..f2d701d 100644 --- a/tiling.js +++ b/tiling.js @@ -42,11 +42,11 @@ ensure_viewport = (meta_window) => { let index = pages.indexOf(meta_window) if (end > global.screen_width) { let delta = start - (end - global.screen_width) - 10 - propogate_backward(index, start - (end - global.screen_width) - 10) propogate_forward(index + 1, global.screen_width) + propogate_backward(index, global.screen_width - 10) } else if (start < 0) { - propogate_forward(pages.indexOf(meta_window), 10) + propogate_forward(index, 10) propogate_backward(index - 1, -global.screen_width) } } @@ -62,16 +62,19 @@ focus_handler = (meta_window, user_data) => { propogate_forward = (n, x) => { if (n < 0 || n >= pages.length) return + print("positioning " + n) let meta_window = pages[n] move(meta_window, x, meta_window.get_frame_rect().y) - propogate_forward(n+1, x+meta_window.get_frame_rect().width) + propogate_forward(n+1, x+meta_window.get_frame_rect().width + 10) } propogate_backward = (n, x) => { if (n < 0 || n >= pages.length) return + print("positioning " + n) let meta_window = pages[n] + x = x - meta_window.get_frame_rect().width move(meta_window, x, meta_window.get_frame_rect().y) - propogate_forward(n-1, x-meta_window.get_frame_rect().width ) + propogate_backward(n-1, x - 10) } focus_wrapper = (meta_window, user_data) => {