mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
add a flag to indicate a menu list instead of overloading 'prompt'
This commit is contained in:
parent
f22a3b1065
commit
a4cba7e113
1
calmwm.h
1
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
|
||||
|
4
menu.c
4
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
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user