summary refs log tree commit diff
path: root/mousefunc.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 /mousefunc.c
parent86b149ad2537061b8af6a51376835c1e1f1cc4ec (diff)
parentac3162439ad826026b499363b445e8c533313ff2 (diff)
downloadcwm-371902b3c9fc6c7419f8134e96d67c8735726ff2.tar.gz
cwm-371902b3c9fc6c7419f8134e96d67c8735726ff2.tar.xz
cwm-371902b3c9fc6c7419f8134e96d67c8735726ff2.zip
cvsimport
Diffstat (limited to 'mousefunc.c')
-rw-r--r--mousefunc.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/mousefunc.c b/mousefunc.c
index fd66edb..4d77482 100644
--- a/mousefunc.c
+++ b/mousefunc.c
@@ -200,13 +200,7 @@ mousefunc_client_hide(struct client_ctx *cc, union arg *arg)
 void
 mousefunc_client_cyclegroup(struct client_ctx *cc, union arg *arg)
 {
-	group_cycle(cc->sc, CWM_CYCLE);
-}
-
-void
-mousefunc_client_rcyclegroup(struct client_ctx *cc, union arg *arg)
-{
-	group_cycle(cc->sc, CWM_RCYCLE);
+	group_cycle(cc->sc, arg->i);
 }
 
 void
@@ -234,11 +228,8 @@ mousefunc_menu_unhide(struct client_ctx *cc, union arg *arg)
 			if (wname == NULL)
 				continue;
 
-			mi = xcalloc(1, sizeof(*mi));
-			(void)snprintf(mi->text, sizeof(mi->text), "(%d) %s",
+			menuq_add(&menuq, cc, "(%d) %s",
 			    cc->group ? cc->group->shortcut : 0, wname);
-			mi->ctx = cc;
-			TAILQ_INSERT_TAIL(&menuq, mi, entry);
 		}
 
 	if (TAILQ_EMPTY(&menuq))
@@ -267,18 +258,14 @@ mousefunc_menu_cmd(struct client_ctx *cc, union arg *arg)
 
 	TAILQ_INIT(&menuq);
 
-	TAILQ_FOREACH(cmd, &Conf.cmdq, entry) {
-		mi = xcalloc(1, sizeof(*mi));
-		(void)strlcpy(mi->text, cmd->label, sizeof(mi->text));
-		mi->ctx = cmd;
-		TAILQ_INSERT_TAIL(&menuq, mi, entry);
-	}
+	TAILQ_FOREACH(cmd, &Conf.cmdq, entry)
+		menuq_add(&menuq, cmd, "%s", cmd->name);
 	if (TAILQ_EMPTY(&menuq))
 		return;
 
 	mi = menu_filter(sc, &menuq, NULL, NULL, 0, NULL, NULL);
 	if (mi != NULL)
-		u_spawn(((struct cmd *)mi->ctx)->image);
+		u_spawn(((struct cmd *)mi->ctx)->path);
 
 	menuq_clear(&menuq);
 }