diff options
author | sabetts <sabetts> | 2001-10-10 06:25:53 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2001-10-10 06:25:53 +0000 |
commit | a3b74d6958b354593c73a601e014738c0de3e4a8 (patch) | |
tree | 58e9811cf04add8eb41b0f358b121030fb1ef743 | |
parent | b538ebeacf38e1605c7ad551ba4d54e140f27916 (diff) | |
download | ratpoison-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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | src/split.c | 25 |
3 files changed, 31 insertions, 3 deletions
@@ -1,5 +1,10 @@ 2001-10-09 shawn <sabetts@vcn.bc.ca> + * src/split.c (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 + * src/list.c (format_window_name): add formatting option '%l' to grab the last_access field from the window. @@ -1,6 +1,10 @@ ratpoison NEWS --- history of user-visible changes. -*- outline -*- * Changes since 1.0.0 +** New windows formatting option %l +Prints a last access number. The higher the number, the more recently +the window was accessed. + ** Remove command line options --kill and --restart Use -c quit and -c restart instead. 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"); |