summary refs log tree commit diff
path: root/group.c
diff options
context:
space:
mode:
authorokan <okan>2014-10-08 12:48:51 +0000
committerokan <okan>2014-10-08 12:48:51 +0000
commit836c9f49d644e52395a12d0805260e070c999099 (patch)
tree439aa78537067b62302252c3c01c1edf24f4beb2 /group.c
parente9dbd150eaf14d230e7aa6191e5762b69e6b1241 (diff)
downloadcwm-836c9f49d644e52395a12d0805260e070c999099.tar.gz
cwm-836c9f49d644e52395a12d0805260e070c999099.tar.xz
cwm-836c9f49d644e52395a12d0805260e070c999099.zip
make group_init work like other *_init's
Diffstat (limited to 'group.c')
-rw-r--r--group.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/group.c b/group.c
index c7933f0..50fb82c 100644
--- a/group.c
+++ b/group.c
@@ -114,24 +114,23 @@ group_restack(struct group_ctx *gc)
 }
 
 void
-group_init(struct screen_ctx *sc)
+group_init(struct screen_ctx *sc, int num)
 {
 	struct group_ctx	*gc;
-	int			 i;
-
-	for (i = 0; i < CALMWM_NGROUPS; i++) {
-		gc = xcalloc(1, sizeof(*gc));
-		gc->sc = sc;
-		TAILQ_INIT(&gc->clientq);
-		gc->name = xstrdup(num_to_name[i]);
-		gc->num = i;
-		TAILQ_INSERT_TAIL(&sc->groupq, gc, entry);
-		if (i == 1)
-			group_setactive(gc);
-	}
+
+	gc = xmalloc(sizeof(*gc));
+	gc->sc = sc;
+	gc->name = xstrdup(num_to_name[num]);
+	gc->num = num;
+	TAILQ_INIT(&gc->clientq);
+
+	TAILQ_INSERT_TAIL(&sc->groupq, gc, entry);
+
+	if (num == 1)
+		group_setactive(gc);
 }
 
-static void
+void
 group_setactive(struct group_ctx *gc)
 {
 	struct screen_ctx	*sc = gc->sc;