summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2015-06-05 15:01:51 +0000
committerokan <okan>2015-06-05 15:01:51 +0000
commita4cba7e113490fdf691ccc52a1cae6629cdf97b4 (patch)
treebc1032960faffcd5bd5c90d23390b72daee53fea
parentf22a3b1065a2b71acfc422cb447445452929b834 (diff)
downloadcwm-a4cba7e113490fdf691ccc52a1cae6629cdf97b4.tar.gz
cwm-a4cba7e113490fdf691ccc52a1cae6629cdf97b4.tar.xz
cwm-a4cba7e113490fdf691ccc52a1cae6629cdf97b4.zip
add a flag to indicate a menu list instead of overloading 'prompt'
-rw-r--r--calmwm.h1
-rw-r--r--menu.c4
-rw-r--r--mousefunc.c6
3 files changed, 7 insertions, 4 deletions
diff --git a/calmwm.h b/calmwm.h
index 3b297b0..69b8a9d 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -73,6 +73,7 @@
 /* menu */
 #define CWM_MENU_DUMMY		0x0001
 #define CWM_MENU_FILE		0x0002
+#define CWM_MENU_LIST		0x0004
 
 #define ARG_CHAR		0x0001
 #define ARG_INT			0x0002
diff --git a/menu.c b/menu.c
index f9a0354..37515bd 100644
--- a/menu.c
+++ b/menu.c
@@ -109,9 +109,11 @@ menu_filter(struct screen_ctx *sc, struct menu_q *menuq, const char *prompt,
 		mc.hasprompt = 1;
 	} else {
 		evmask = MENUMASK;
-		mc.list = 1;
 	}
 
+	if (mc.flags & CWM_MENU_LIST)
+		mc.list = 1;
+
 	if (initial != NULL)
 		(void)strlcpy(mc.searchstr, initial, sizeof(mc.searchstr));
 	else
diff --git a/mousefunc.c b/mousefunc.c
index 271e732..a1d7e06 100644
--- a/mousefunc.c
+++ b/mousefunc.c
@@ -191,7 +191,7 @@ mousefunc_menu_group(struct client_ctx *cc, union arg *arg)
 	if (TAILQ_EMPTY(&menuq))
 		return;
 
-	if ((mi = menu_filter(sc, &menuq, NULL, NULL, 0,
+	if ((mi = menu_filter(sc, &menuq, NULL, NULL, CWM_MENU_LIST,
 	    NULL, NULL)) != NULL) {
 		gc = (struct group_ctx *)mi->ctx;
 		(group_holds_only_hidden(gc)) ?
@@ -225,7 +225,7 @@ mousefunc_menu_unhide(struct client_ctx *cc, union arg *arg)
 	if (TAILQ_EMPTY(&menuq))
 		return;
 
-	if ((mi = menu_filter(sc, &menuq, NULL, NULL, 0,
+	if ((mi = menu_filter(sc, &menuq, NULL, NULL, CWM_MENU_LIST,
 	    NULL, NULL)) != NULL) {
 		cc = (struct client_ctx *)mi->ctx;
 		client_unhide(cc);
@@ -251,7 +251,7 @@ mousefunc_menu_cmd(struct client_ctx *cc, union arg *arg)
 	if (TAILQ_EMPTY(&menuq))
 		return;
 
-	if ((mi = menu_filter(sc, &menuq, NULL, NULL, 0,
+	if ((mi = menu_filter(sc, &menuq, NULL, NULL, CWM_MENU_LIST,
 	    NULL, NULL)) != NULL)
 		u_spawn(((struct cmd *)mi->ctx)->path);