diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-04-13 14:46:05 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-04-13 14:46:05 +0000 |
commit | 209c1b999f121d23cb4604659577998e9c854d0c (patch) | |
tree | 939d848fe4cad53c8bb66c06919d438695615d57 /usr.bin/tmux/cmd-display-menu.c | |
parent | b38a262a57ad0941a41ed3626664891772f6444e (diff) |
Move cmdq_state into cmd-queue.c.
Diffstat (limited to 'usr.bin/tmux/cmd-display-menu.c')
-rw-r--r-- | usr.bin/tmux/cmd-display-menu.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/tmux/cmd-display-menu.c b/usr.bin/tmux/cmd-display-menu.c index 51b57bec412..118defbe98a 100644 --- a/usr.bin/tmux/cmd-display-menu.c +++ b/usr.bin/tmux/cmd-display-menu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-display-menu.c,v 1.16 2020/04/13 14:04:25 nicm Exp $ */ +/* $OpenBSD: cmd-display-menu.c,v 1.17 2020/04/13 14:46:04 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -65,8 +65,8 @@ static void cmd_display_menu_get_position(struct client *c, struct cmdq_item *item, struct args *args, u_int *px, u_int *py, u_int w, u_int h) { - struct cmdq_state *state = cmdq_get_state(item); struct cmd_find_state *target = cmdq_get_target(item); + struct key_event *event = cmdq_get_event(item); struct session *s = c->session; struct winlink *wl = target->wl; struct window_pane *wp = target->wp; @@ -100,8 +100,8 @@ cmd_display_menu_get_position(struct client *c, struct cmdq_item *item, else *px = 0; } else if (strcmp(xp, "M") == 0) { - if (state->event.m.valid && state->event.m.x > w / 2) - *px = state->event.m.x - w / 2; + if (event->m.valid && event->m.x > w / 2) + *px = event->m.x - w / 2; else *px = 0; } else if (strcmp(xp, "W") == 0) { @@ -134,8 +134,8 @@ cmd_display_menu_get_position(struct client *c, struct cmdq_item *item, else *py = 0; } else if (strcmp(yp, "M") == 0) { - if (state->event.m.valid) - *py = state->event.m.y + h; + if (event->m.valid) + *py = event->m.y + h; else *py = 0; } else if (strcmp(yp, "S") == 0) { @@ -176,8 +176,8 @@ static enum cmd_retval cmd_display_menu_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); - struct cmdq_state *state = cmdq_get_state(item); struct cmd_find_state *target = cmdq_get_target(item); + struct key_event *event = cmdq_get_event(item); struct client *c; struct menu *menu = NULL; struct menu_item menu_item; @@ -230,7 +230,7 @@ cmd_display_menu_exec(struct cmd *self, struct cmdq_item *item) cmd_display_menu_get_position(c, item, args, &px, &py, menu->width + 4, menu->count + 2); - if (!state->event.m.valid) + if (!event->m.valid) flags |= MENU_NOMOUSE; if (menu_display(menu, flags, item, px, py, c, target, NULL, NULL) != 0) return (CMD_RETURN_NORMAL); |