# HG changeset patch # User telesto # Date 1708244504 -3600 # Sun Feb 18 09:21:44 2024 +0100 # Node ID 6550482d95bc4bdd9818ade9c39abb814244a103 # Parent ec880d21b8accb116438f15840e138a7cbaa8e6d fix a off by 1 error in within? diff --git a/swapwm.fox b/swapwm.fox --- a/swapwm.fox +++ b/swapwm.fox @@ -487,9 +487,10 @@ \ ----------- multihead support \ ------------ find the screen a window is in - \ x <= x1 <= x+w? + \ x <= x1 < x+w? ( x1 x w -- 1|0 ) -: within? over + rpush over - neg drop -if rdrop dup - ;; then +: within? 1- \ x+w is the first pixel on the next screen! + over + rpush over - neg drop -if rdrop dup - ;; then rpop - neg -if dup - ;; then drop 1 ; ( x scr -- 0|1 )