From df64022d3e7c09826c573a050e537b639afb8034 Mon Sep 17 00:00:00 2001 From: sabetts Date: Sat, 7 Apr 2001 02:57:41 +0000 Subject: * src/split.c (maximize_frame): new function (create_initial_frame): calls maximize_frame to fill in the initial frame's fields. (num_frames): comment out (remove_frame): remove special case when there is only 1 frame left. --- src/split.c | 61 +++++++++++++++++++++++++++++-------------------------------- 1 file changed, 29 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/split.c b/src/split.c index 5c00572..e2ec89c 100644 --- a/src/split.c +++ b/src/split.c @@ -33,27 +33,33 @@ delete_frame_from_list (rp_window_frame *frame) frame->prev->next = frame->next; } -/* Create a full screen frame */ +/* Make the frame occupy the entire screen */ static void -create_initial_frame () +maximize_frame (rp_window_frame *frame) { screen_info *s; - s = current_screen(); - rp_current_frame = xmalloc (sizeof (rp_window_frame)); - rp_current_frame = xmalloc (sizeof (rp_window_frame)); - rp_current_frame->x = PADDING_LEFT; - rp_current_frame->y = PADDING_TOP; + frame->x = PADDING_LEFT; + frame->y = PADDING_TOP; /* FIXME: what about multiple screens? */ - rp_current_frame->width = DisplayWidth (dpy, 0) - PADDING_RIGHT - PADDING_LEFT; - rp_current_frame->height = DisplayHeight (dpy, 0) - PADDING_BOTTOM - PADDING_TOP; + frame->width = DisplayWidth (dpy, 0) - PADDING_RIGHT - PADDING_LEFT; + frame->height = DisplayHeight (dpy, 0) - PADDING_BOTTOM - PADDING_TOP; +} + +/* Create a full screen frame */ +static void +create_initial_frame () +{ + rp_current_frame = xmalloc (sizeof (rp_window_frame)); rp_window_frame_sentinel->next = rp_current_frame; rp_window_frame_sentinel->prev = rp_current_frame; rp_current_frame->next = rp_window_frame_sentinel; rp_current_frame->prev = rp_window_frame_sentinel; + + maximize_frame (rp_current_frame); rp_current_frame->win = NULL; } @@ -322,21 +328,21 @@ total_frame_area () return area; } -static int -num_frames () -{ - int count = 0; - rp_window_frame *cur; +/* static int */ +/* num_frames () */ +/* { */ +/* int count = 0; */ +/* rp_window_frame *cur; */ - for (cur = rp_window_frame_sentinel->next; - cur != rp_window_frame_sentinel; - cur = cur->next) - { - count++; - } +/* for (cur = rp_window_frame_sentinel->next; */ +/* cur != rp_window_frame_sentinel; */ +/* cur = cur->next) */ +/* { */ +/* count++; */ +/* } */ - return count; -} +/* return count; */ +/* } */ /* Return 1 if frames f1 and f2 overlap */ static int @@ -383,15 +389,6 @@ remove_frame (rp_window_frame *frame) delete_frame_from_list (frame); - /* If there is 1 frame then we have no split screen, so get rid - of the remaining window frame. */ - if (num_frames() <= 1) - { - remove_all_splits (); - free (frame); - return; - } - for (cur = rp_window_frame_sentinel->next; cur != rp_window_frame_sentinel; cur = cur->next) @@ -467,7 +464,7 @@ remove_frame (rp_window_frame *frame) memcpy (cur, &tmp_frame, sizeof (rp_window_frame)); } } - + free (frame); } -- cgit v1.2.3