summary refs log tree commit diff
path: root/group.c
diff options
context:
space:
mode:
authorokan <okan>2014-01-21 15:42:44 +0000
committerokan <okan>2014-01-21 15:42:44 +0000
commit371902b3c9fc6c7419f8134e96d67c8735726ff2 (patch)
tree4963c37a48000819c291dabede7d429572398352 /group.c
parent86b149ad2537061b8af6a51376835c1e1f1cc4ec (diff)
parentac3162439ad826026b499363b445e8c533313ff2 (diff)
downloadcwm-371902b3c9fc6c7419f8134e96d67c8735726ff2.tar.gz
cwm-371902b3c9fc6c7419f8134e96d67c8735726ff2.tar.xz
cwm-371902b3c9fc6c7419f8134e96d67c8735726ff2.zip
cvsimport
Diffstat (limited to 'group.c')
-rw-r--r--group.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/group.c b/group.c
index 12a30e1..fe5eb3a 100644
--- a/group.c
+++ b/group.c
@@ -324,15 +324,8 @@ group_menu(struct screen_ctx *sc)
 		if (TAILQ_EMPTY(&gc->clients))
 			continue;
 
-		mi = xcalloc(1, sizeof(*mi));
-		if (gc->hidden)
-			(void)snprintf(mi->text, sizeof(mi->text), "%d: [%s]",
-			    gc->shortcut, sc->group_names[i]);
-		else
-			(void)snprintf(mi->text, sizeof(mi->text), "%d: %s",
-			    gc->shortcut, sc->group_names[i]);
-		mi->ctx = gc;
-		TAILQ_INSERT_TAIL(&menuq, mi, entry);
+		menuq_add(&menuq, gc, gc->hidden ? "%d: [%s]" : "%d: %s",
+		    gc->shortcut, sc->group_names[i]);
 	}
 
 	if (TAILQ_EMPTY(&menuq))