aboutsummaryrefslogtreecommitdiffstats
path: root/group.c
diff options
context:
space:
mode:
authorokan2019-02-25 16:40:49 +0000
committerokan2019-02-25 16:40:49 +0000
commit8f7c934cef0f223e5fc0d06b2f0cba386b5b8fd8 (patch)
tree9b2063e8cccf02d9d7066bc7d2109a74f2805f3e /group.c
parentcd6bd49abd762f448b4b352b69e2cc9f9ca5dfef (diff)
downloadcwm-8f7c934cef0f223e5fc0d06b2f0cba386b5b8fd8.tar.gz
Add 'group-close-[n]' action to close all windows within specified group.
heavily based on a diff from Nam Nguyen.
Diffstat (limited to 'group.c')
-rw-r--r--group.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/group.c b/group.c
index 106ee0a..c07d2d3 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.128 2018/01/23 13:48:49 okan Exp $
+ * $OpenBSD: group.c,v 1.129 2019/02/25 16:40:49 okan Exp $
*/
#include <sys/types.h>
@@ -250,6 +250,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)
{
struct group_ctx *newgc, *oldgc, *showgroup = NULL;