summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2014-01-29 22:30:00 +0000
committerokan <okan>2014-01-29 22:30:00 +0000
commit2be890489b8542b12f77133fbba404210c1b5f54 (patch)
treee1934ef9a514b97a4779f90886175b8398a9dacd
parent59fe14bd2f2876beb16497f950ce589ccab4beb6 (diff)
downloadcwm-2be890489b8542b12f77133fbba404210c1b5f54.tar.gz
cwm-2be890489b8542b12f77133fbba404210c1b5f54.tar.xz
cwm-2be890489b8542b12f77133fbba404210c1b5f54.zip
Minimize trivial differences between a few kb and mb functions.
-rw-r--r--calmwm.h2
-rw-r--r--conf.c2
-rw-r--r--kbfunc.c2
-rw-r--r--mousefunc.c13
4 files changed, 9 insertions, 10 deletions
diff --git a/calmwm.h b/calmwm.h
index 14ffcf2..f71426d 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -477,7 +477,7 @@ void			 kbfunc_cmdexec(struct client_ctx *, union arg *);
 void			 kbfunc_cwm_status(struct client_ctx *, union arg *);
 void			 kbfunc_exec(struct client_ctx *, union arg *);
 void			 kbfunc_lock(struct client_ctx *, union arg *);
-void			 kbfunc_menu_search(struct client_ctx *, union arg *);
+void			 kbfunc_menu_cmd(struct client_ctx *, union arg *);
 void			 kbfunc_ssh(struct client_ctx *, union arg *);
 void			 kbfunc_term(struct client_ctx *, union arg *);
 void 			 kbfunc_tile(struct client_ctx *, union arg *);
diff --git a/conf.c b/conf.c
index 7f0c659..e4b4dbb 100644
--- a/conf.c
+++ b/conf.c
@@ -353,7 +353,7 @@ static const struct {
 	{ "lower", kbfunc_client_lower, CWM_WIN, {0} },
 	{ "raise", kbfunc_client_raise, CWM_WIN, {0} },
 	{ "search", kbfunc_client_search, 0, {0} },
-	{ "menusearch", kbfunc_menu_search, 0, {0} },
+	{ "menusearch", kbfunc_menu_cmd, 0, {0} },
 	{ "hide", kbfunc_client_hide, CWM_WIN, {0} },
 	{ "cycle", kbfunc_client_cycle, 0, {.i = CWM_CYCLE} },
 	{ "rcycle", kbfunc_client_cycle, 0, {.i = CWM_RCYCLE} },
diff --git a/kbfunc.c b/kbfunc.c
index d44f63b..705baef 100644
--- a/kbfunc.c
+++ b/kbfunc.c
@@ -167,7 +167,7 @@ kbfunc_client_search(struct client_ctx *cc, union arg *arg)
 }
 
 void
-kbfunc_menu_search(struct client_ctx *cc, union arg *arg)
+kbfunc_menu_cmd(struct client_ctx *cc, union arg *arg)
 {
 	struct screen_ctx	*sc = cc->sc;
 	struct cmd		*cmd;
diff --git a/mousefunc.c b/mousefunc.c
index 72953b2..73c3449 100644
--- a/mousefunc.c
+++ b/mousefunc.c
@@ -221,7 +221,6 @@ mousefunc_menu_unhide(struct client_ctx *cc, union arg *arg)
 	old_cc = client_current();
 
 	TAILQ_INIT(&menuq);
-
 	TAILQ_FOREACH(cc, &Clientq, entry)
 		if (cc->flags & CLIENT_HIDDEN) {
 			wname = (cc->label) ? cc->label : cc->name;
@@ -235,8 +234,8 @@ mousefunc_menu_unhide(struct client_ctx *cc, union arg *arg)
 	if (TAILQ_EMPTY(&menuq))
 		return;
 
-	mi = menu_filter(sc, &menuq, NULL, NULL, 0, NULL, NULL);
-	if (mi != NULL) {
+	if ((mi = menu_filter(sc, &menuq, NULL, NULL, 0,
+	    NULL, NULL)) != NULL) {
 		cc = (struct client_ctx *)mi->ctx;
 		client_unhide(cc);
 
@@ -252,19 +251,19 @@ void
 mousefunc_menu_cmd(struct client_ctx *cc, union arg *arg)
 {
 	struct screen_ctx	*sc = cc->sc;
+	struct cmd		*cmd;
 	struct menu		*mi;
 	struct menu_q		 menuq;
-	struct cmd		*cmd;
 
 	TAILQ_INIT(&menuq);
-
 	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)
+	if ((mi = menu_filter(sc, &menuq, NULL, NULL, 0,
+	    NULL, NULL)) != NULL)
 		u_spawn(((struct cmd *)mi->ctx)->path);
 
 	menuq_clear(&menuq);