diff options
author | okan | 2013-12-02 19:30:27 +0000 |
---|---|---|
committer | okan | 2013-12-02 19:30:27 +0000 |
commit | cf859c3404f849ec7907cfbc1e0f89e496b4a823 (patch) | |
tree | 9427e817aff19d9ed1231c9a72b923a044037dd8 | |
parent | 1384341ce93769fbdfac062a89bec7d94bd205b9 (diff) | |
download | cwm-cf859c3404f849ec7907cfbc1e0f89e496b4a823.tar.gz |
Prepend the group shortcut in the client search menu; from Thomas Adam.
Likewise, prepend shortcut in unhide menu.
-rw-r--r-- | mousefunc.c | 5 | ||||
-rw-r--r-- | search.c | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/mousefunc.c b/mousefunc.c index 6de0e14..c634333 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.59 2013/11/27 18:34:34 okan Exp $ + * $OpenBSD: mousefunc.c,v 1.60 2013/12/02 19:30:27 okan Exp $ */ #include <sys/param.h> @@ -231,7 +231,8 @@ mousefunc_menu_unhide(struct client_ctx *cc, void *arg) continue; mi = xcalloc(1, sizeof(*mi)); - (void)strlcpy(mi->text, wname, sizeof(mi->text)); + (void)snprintf(mi->text, sizeof(mi->text), + "(%d) %s", cc->group->shortcut, wname); mi->ctx = cc; TAILQ_INSERT_TAIL(&menuq, mi, entry); } @@ -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: search.c,v 1.31 2013/04/30 21:11:07 okan Exp $ + * $OpenBSD: search.c,v 1.32 2013/12/02 19:30:27 okan Exp $ */ #include <sys/param.h> @@ -142,8 +142,8 @@ search_print_client(struct menu *mi, int list) if (list) cc->matchname = cc->name; - (void)snprintf(mi->print, sizeof(mi->print), "%c%s", flag, - cc->matchname); + (void)snprintf(mi->print, sizeof(mi->print), "(%d) %c%s", + cc->group->shortcut, flag, cc->matchname); if (!list && cc->matchname != cc->name && strlen(mi->print) < sizeof(mi->print) - 1) { |