summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Busque <antoinebusque@gmail.com>2017-06-26 18:04:19 -0400
committerJérémie Courrèges-Anglas <jca@wxcvbn.org>2017-07-04 03:41:28 +0200
commit4b7b0468cd96fe27d7718ad91718d3ac2e0668cb (patch)
tree5a6f69293dcb9e7354981a8b639012c6c185757a
parentc7398ce2a662879c1f529cfff1b9e5675a31914b (diff)
downloadratpoison-4b7b0468cd96fe27d7718ad91718d3ac2e0668cb.zip
Fix: check frame overlap in find_frame_left, find_frame_right
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 <antoinebusque@gmail.com>
-rw-r--r--src/split.c4
1 files 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;
}
}