From a5ba9aa9da9567244d1c3d1d8ccacfdb51b044de Mon Sep 17 00:00:00 2001 From: okan Date: Mon, 25 Feb 2019 16:40:49 +0000 Subject: Add 'group-close-[n]' action to close all windows within specified group. heavily based on a diff from Nam Nguyen. --- group.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'group.c') diff --git a/group.c b/group.c index 4c25bcc..30fe718 100644 --- a/group.c +++ b/group.c @@ -249,6 +249,23 @@ group_only(struct screen_ctx *sc, int idx) } } +void +group_close(struct screen_ctx *sc, int idx) +{ + struct group_ctx *gc; + struct client_ctx *cc; + + if (idx < 0 || idx >= Conf.ngroups) + return; + + TAILQ_FOREACH(gc, &sc->groupq, entry) { + if (gc->num == idx) { + TAILQ_FOREACH(cc, &gc->clientq, group_entry) + client_close(cc); + } + } +} + void group_cycle(struct screen_ctx *sc, int flags) { -- cgit 1.4.1