From c41a4e4f8740a3150cb0ed54c5972e075f503b74 Mon Sep 17 00:00:00 2001 From: okan Date: Thu, 7 Dec 2017 16:03:10 +0000 Subject: give command and group menus their own match callbacks --- kbfunc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'kbfunc.c') diff --git a/kbfunc.c b/kbfunc.c index a645f54..3959046 100644 --- a/kbfunc.c +++ b/kbfunc.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: kbfunc.c,v 1.151 2017/12/07 15:39:47 okan Exp $ + * $OpenBSD: kbfunc.c,v 1.152 2017/12/07 16:03:10 okan Exp $ */ #include @@ -460,14 +460,13 @@ kbfunc_menu_cmd(void *ctx, struct cargs *cargs) if ((strcmp(cmd->name, "lock") == 0) || (strcmp(cmd->name, "term") == 0)) continue; - /* search_match_text() needs mi->text */ - menuq_add(&menuq, cmd, "%s", cmd->name); + menuq_add(&menuq, cmd, NULL); } if ((mi = menu_filter(sc, &menuq, (m) ? NULL : "application", NULL, ((m) ? CWM_MENU_LIST : 0), - search_match_text, search_print_cmd)) != NULL) { + search_match_cmd, search_print_cmd)) != NULL) { cmd = (struct cmd_ctx *)mi->ctx; u_spawn(cmd->path); } @@ -488,12 +487,12 @@ kbfunc_menu_group(void *ctx, struct cargs *cargs) TAILQ_FOREACH(gc, &sc->groupq, entry) { if (group_holds_only_sticky(gc)) continue; - menuq_add(&menuq, gc, "%d %s", gc->num, gc->name); + menuq_add(&menuq, gc, NULL); } if ((mi = menu_filter(sc, &menuq, (m) ? NULL : "group", NULL, (CWM_MENU_LIST), - search_match_text, search_print_group)) != NULL) { + search_match_group, search_print_group)) != NULL) { gc = (struct group_ctx *)mi->ctx; (group_holds_only_hidden(gc)) ? group_show(gc) : group_hide(gc); -- cgit v1.2.3-2-gb3c3