When compared with the existing overlap check in
`find_frame_{up,down}`, it appears that the original implementation of
the overlap test for `find_frame_{left,right}` is erroneous. Indeed,
the wrong boundaries are used, which causes issues like allowing
finding a frame in one direction, but not finding the frame when going
back in the reverse direction.

Commands like `focus{left,right}` rely on the corresponding
`find_frame` function. The original boundaries check issue meant that,
on differently sized screens, focus could pass from one screen to the
next in one direction, but not in the other.

The boundary checks have therefore been corrected to mirror those in
`find_frame_{up,down}`, and check for actual overlap between the
frames.

Signed-off-by: Antoine Busque <antoinebus...@gmail.com>
---
 src/split.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/split.c b/src/split.c
index a9d69cd..98c0cda 100644
--- a/src/split.c
+++ b/src/split.c
@@ -1046,7 +1046,7 @@ find_frame_left (rp_frame *frame)
       list_for_each_entry (cur, &s->frames, node)
         {
           if (frame_left_abs (frame) == frame_right_abs (cur))
-            if (frame_top_abs (frame) >= frame_top_abs (cur) && frame_top_abs 
(frame) < frame_bottom_abs (cur))
+            if (frame_bottom_abs (frame) >= frame_top_abs (cur) && 
frame_top_abs (frame) <= frame_bottom_abs (cur))
               return cur;
         }
     }
@@ -1065,7 +1065,7 @@ find_frame_right (rp_frame *frame)
       list_for_each_entry (cur, &s->frames, node)
         {
           if (frame_right_abs (frame) == frame_left_abs (cur))
-            if (frame_top_abs (frame) >= frame_top_abs (cur) && frame_top_abs 
(frame) < frame_bottom_abs (cur))
+            if (frame_bottom_abs (frame) >= frame_top_abs (cur) && 
frame_top_abs (frame) <= frame_bottom_abs (cur))
               return cur;
         }
     }
-- 
2.13.1


_______________________________________________
Ratpoison-devel mailing list
Ratpoison-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/ratpoison-devel

Reply via email to