diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2015-07-12 14:31:48 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2015-07-12 14:31:48 +0000 |
commit | 6277fea1ff79f467de318738affc94191c925a73 (patch) | |
tree | 9c35fd598f3be206d2f26aa4f32ce4e5be676036 /app/cwm/kbfunc.c | |
parent | e1c71b6a033e9d98703e3816a2f82c9ca58d0ef8 (diff) |
introduce 'groupsearch' for group menu search; matches on either group
number/shortcut and/or name.
Diffstat (limited to 'app/cwm/kbfunc.c')
-rw-r--r-- | app/cwm/kbfunc.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c index d3c54a03a..046c89846 100644 --- a/app/cwm/kbfunc.c +++ b/app/cwm/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.112 2015/07/03 17:11:16 okan Exp $ + * $OpenBSD: kbfunc.c,v 1.113 2015/07/12 14:31:47 okan Exp $ */ #include <sys/types.h> @@ -188,6 +188,31 @@ kbfunc_menu_cmd(struct client_ctx *cc, union arg *arg) } void +kbfunc_menu_group(struct client_ctx *cc, union arg *arg) +{ + struct screen_ctx *sc = cc->sc; + struct group_ctx *gc; + struct menu *mi; + struct menu_q menuq; + + TAILQ_INIT(&menuq); + TAILQ_FOREACH(gc, &sc->groupq, entry) { + if (group_holds_only_sticky(gc)) + continue; + menuq_add(&menuq, gc, "%d %s", gc->num, gc->name); + } + + if ((mi = menu_filter(sc, &menuq, "group", NULL, CWM_MENU_LIST, + search_match_text, search_print_group)) != NULL) { + gc = (struct group_ctx *)mi->ctx; + (group_holds_only_hidden(gc)) ? + group_show(gc) : group_hide(gc); + } + + menuq_clear(&menuq); +} + +void kbfunc_client_cycle(struct client_ctx *cc, union arg *arg) { struct screen_ctx *sc = cc->sc; |