summaryrefslogtreecommitdiff
path: root/src/split.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-04-07 02:57:41 +0000
committersabetts <sabetts>2001-04-07 02:57:41 +0000
commitdf64022d3e7c09826c573a050e537b639afb8034 (patch)
treee6c2797940cce5840bce078991fe364993a09998 /src/split.c
parent4ef01dc374bd76295e7a46140591e516187e33df (diff)
downloadratpoison-df64022d3e7c09826c573a050e537b639afb8034.zip
* 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.
Diffstat (limited to 'src/split.c')
-rw-r--r--src/split.c61
1 files changed, 29 insertions, 32 deletions
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);
}