diff options
author | okan | 2016-09-22 14:36:03 +0000 |
---|---|---|
committer | okan | 2016-09-22 14:36:03 +0000 |
commit | fcf63f35482fd6d0e4ae011cd944289d576d0d44 (patch) | |
tree | 779eab51a3aab94fa6f09cf9094bc2229f91d5b7 /mousefunc.c | |
parent | 1ccd2b29745acb096b33808dfac0a1b65b597f49 (diff) | |
download | cwm-fcf63f35482fd6d0e4ae011cd944289d576d0d44.tar.gz |
Continue merging kb and mouse functions: fold
mousefunc_menu_{client,cmd,group} into the respective
kbfunc_menu_{client,cmd,group} functions; simply pass a flag down from
config denoting mouse action behaviour.
Diffstat (limited to 'mousefunc.c')
-rw-r--r-- | mousefunc.c | 79 |
1 files changed, 1 insertions, 78 deletions
diff --git a/mousefunc.c b/mousefunc.c index f72416f..8fa3c82 100644 --- a/mousefunc.c +++ b/mousefunc.c @@ -16,7 +16,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: mousefunc.c,v 1.104 2016/09/13 13:42:28 okan Exp $ + * $OpenBSD: mousefunc.c,v 1.105 2016/09/22 14:36:03 okan Exp $ */ #include <sys/types.h> @@ -155,80 +155,3 @@ mousefunc_client_move(struct client_ctx *cc, union arg *arg) } /* NOTREACHED */ } - -void -mousefunc_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, NULL, NULL, CWM_MENU_LIST, - NULL, 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 -mousefunc_menu_client(struct client_ctx *cc, union arg *arg) -{ - struct screen_ctx *sc = cc->sc; - struct client_ctx *old_cc; - struct menu *mi; - struct menu_q menuq; - - old_cc = client_current(); - - TAILQ_INIT(&menuq); - TAILQ_FOREACH(cc, &sc->clientq, entry) { - if (cc->flags & CLIENT_HIDDEN) { - menuq_add(&menuq, cc, NULL); - } - } - - if ((mi = menu_filter(sc, &menuq, NULL, NULL, CWM_MENU_LIST, - NULL, search_print_client)) != NULL) { - cc = (struct client_ctx *)mi->ctx; - client_unhide(cc); - if (old_cc != NULL) - client_ptrsave(old_cc); - client_ptrwarp(cc); - } - - menuq_clear(&menuq); -} - -void -mousefunc_menu_cmd(struct client_ctx *cc, union arg *arg) -{ - struct screen_ctx *sc = cc->sc; - struct cmd *cmd; - struct menu *mi; - struct menu_q menuq; - - TAILQ_INIT(&menuq); - 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) - u_spawn(((struct cmd *)mi->ctx)->path); - - menuq_clear(&menuq); -} |