Instead of special casing the 'term' and 'lock' commands, go back to

keeping them hidden; showing them has apparently caused confusion/angst.
This commit is contained in:
okan 2015-08-21 16:05:55 +00:00
parent a79253abdc
commit c96fd247dd
3 changed files with 12 additions and 10 deletions

View File

@ -177,8 +177,12 @@ kbfunc_menu_cmd(struct client_ctx *cc, union arg *arg)
struct menu_q menuq;
TAILQ_INIT(&menuq);
TAILQ_FOREACH(cmd, &Conf.cmdq, entry)
menuq_add(&menuq, cmd, "%s", cmd->name);
TAILQ_FOREACH(cmd, &Conf.cmdq, entry) {
if ((strcmp(cmd->name, "lock") == 0) ||
(strcmp(cmd->name, "term") == 0))
continue;
menuq_add(&menuq, cmd, NULL);
}
if ((mi = menu_filter(sc, &menuq, "application", NULL, 0,
search_match_text, search_print_cmd)) != NULL)

View File

@ -233,8 +233,12 @@ mousefunc_menu_cmd(struct client_ctx *cc, union arg *arg)
struct menu_q menuq;
TAILQ_INIT(&menuq);
TAILQ_FOREACH(cmd, &Conf.cmdq, entry)
TAILQ_FOREACH(cmd, &Conf.cmdq, entry) {
if ((strcmp(cmd->name, "lock") == 0) ||
(strcmp(cmd->name, "term") == 0))
continue;
menuq_add(&menuq, cmd, NULL);
}
if ((mi = menu_filter(sc, &menuq, NULL, NULL, CWM_MENU_LIST,
NULL, search_print_cmd)) != NULL)

View File

@ -127,14 +127,8 @@ void
search_print_cmd(struct menu *mi, int i)
{
struct cmd *cmd = (struct cmd *)mi->ctx;
int special = 0;
if ((strcmp(cmd->name, "lock") == 0) ||
(strcmp(cmd->name, "term") == 0))
special = 1;
(void)snprintf(mi->print, sizeof(mi->print),
(special) ? "[%s]" : "%s", cmd->name);
(void)snprintf(mi->print, sizeof(mi->print), "%s", cmd->name);
}
void