mirror of
https://github.com/gosticks/PaperWM.git
synced 2026-10-05 11:46:57 +00:00
Fix propogate_backward
Used the width of the wrong window to calculate the position, and called propogata forward instead (duh).
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user