aboutsummaryrefslogtreecommitdiffstats
path: root/group.c
diff options
context:
space:
mode:
authorokan2014-10-08 12:48:51 +0000
committerokan2014-10-08 12:48:51 +0000
commite72e46b0d681747a7c2632c6a2f76c77ff8e05e4 (patch)
tree82f1620da2a37989c57b1a9832c804cc0dd13d5b /group.c
parentb5481390e265e33e692a40dd261f165a7ed99e3e (diff)
downloadcwm-e72e46b0d681747a7c2632c6a2f76c77ff8e05e4.tar.gz
make group_init work like other *_init's
Diffstat (limited to '')
-rw-r--r--group.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/group.c b/group.c
index bbc3f39..87c307d 100644
--- a/group.c
+++ b/group.c
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: group.c,v 1.108 2014/09/27 19:04:32 okan Exp $
+ * $OpenBSD: group.c,v 1.109 2014/10/08 12:48:51 okan Exp $
*/
#include <sys/param.h>
@@ -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;