summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-10-10 06:25:53 +0000
committersabetts <sabetts>2001-10-10 06:25:53 +0000
commita3b74d6958b354593c73a601e014738c0de3e4a8 (patch)
tree58e9811cf04add8eb41b0f358b121030fb1ef743 /src
parentb538ebeacf38e1605c7ad551ba4d54e140f27916 (diff)
downloadratpoison-a3b74d6958b354593c73a601e014738c0de3e4a8.zip
(remove_frame): Make sure the frame attempting to
take up the space of the deleted frame overlaps the deleted frame after the size change. (remove_frame): More debug messages
Diffstat (limited to 'src')
-rw-r--r--src/split.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/split.c b/src/split.c
index e92f19d..a27ec2b 100644
--- a/src/split.c
+++ b/src/split.c
@@ -88,7 +88,7 @@ create_initial_frame ()
rp_current_frame->prev = rp_window_frame_sentinel;
maximize_frame (rp_current_frame);
-
+
set_frames_window (rp_current_frame, NULL);
}
@@ -444,6 +444,15 @@ remove_frame (rp_window_frame *frame)
rp_window_frame tmp_frame;
int fits = 0;
+ if (cur->win)
+ {
+ PRINT_DEBUG ("Trying frame containing window '%s'\n", window_name (cur->win));
+ }
+ else
+ {
+ PRINT_DEBUG ("Trying some empty frame\n");
+ }
+
/* Backup the frame */
memcpy (&tmp_frame, cur, sizeof (rp_window_frame));
@@ -455,9 +464,17 @@ remove_frame (rp_window_frame *frame)
cur->height += frame->height;
}
+ PRINT_DEBUG ("Attempting vertical Frame y=%d height=%d\n", cur->y, cur->height);
PRINT_DEBUG ("New Total Area: %d\n", total_frame_area());
- if (total_frame_area() > area || frame_overlaps (cur))
+ /* If the area is bigger than before, the frame takes up too
+ much space. If the current frame and the deleted frame DON'T
+ overlap then the current window took up just the right amount
+ of space but didn't take up the space left behind by the
+ deleted window. If any active frames overlap, it could have
+ taken up the right amount of space, overlaps with the deleted
+ frame but obviously didn't fit. */
+ if (total_frame_area() > area || !frames_overlap (cur, frame) || frame_overlaps (cur))
{
PRINT_DEBUG ("Didn't fit vertically\n");
@@ -481,9 +498,11 @@ remove_frame (rp_window_frame *frame)
cur->width += frame->width;
}
+ PRINT_DEBUG ("Attempting horizontal Frame x=%d width=%d\n", cur->x, cur->width);
PRINT_DEBUG ("New Total Area: %d\n", total_frame_area());
- if (total_frame_area() > area || frame_overlaps (cur))
+ /* Same test as the vertical test, above. */
+ if (total_frame_area() > area || !frames_overlap (cur, frame) || frame_overlaps (cur))
{
PRINT_DEBUG ("Didn't fit horizontally\n");