=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/popup.c,v retrieving revision 1.5 retrieving revision 1.6 diff -c -r1.5 -r1.6 *** src/usr.bin/tmux/popup.c 2020/03/31 06:35:38 1.5 --- src/usr.bin/tmux/popup.c 2020/04/01 09:05:27 1.6 *************** *** 1,4 **** ! /* $OpenBSD: popup.c,v 1.5 2020/03/31 06:35:38 nicm Exp $ */ /* * Copyright (c) 2020 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: popup.c,v 1.6 2020/04/01 09:05:27 nicm Exp $ */ /* * Copyright (c) 2020 Nicholas Marriott *************** *** 225,231 **** struct cmdq_item *new_item; struct cmd_parse_result *pr; struct format_tree *ft; ! const char *cmd; if (KEYC_IS_MOUSE(event->key)) { if (pd->dragging != OFF) { --- 225,232 ---- struct cmdq_item *new_item; struct cmd_parse_result *pr; struct format_tree *ft; ! const char *cmd, *buf; ! size_t len; if (KEYC_IS_MOUSE(event->key)) { if (pd->dragging != OFF) { *************** *** 258,271 **** } if (pd->ictx != NULL && (pd->flags & POPUP_WRITEKEYS)) { - if (KEYC_IS_MOUSE(event->key)) - return (0); if (((pd->flags & (POPUP_CLOSEEXIT|POPUP_CLOSEEXITZERO)) == 0 || pd->job == NULL) && (event->key == '\033' || event->key == '\003')) return (1); if (pd->job == NULL) return (0); input_key(NULL, &pd->s, job_get_event(pd->job), event->key); return (0); } --- 259,278 ---- } if (pd->ictx != NULL && (pd->flags & POPUP_WRITEKEYS)) { if (((pd->flags & (POPUP_CLOSEEXIT|POPUP_CLOSEEXITZERO)) == 0 || pd->job == NULL) && (event->key == '\033' || event->key == '\003')) return (1); if (pd->job == NULL) return (0); + if (KEYC_IS_MOUSE(event->key)) { + /* Must be inside, checked already. */ + if (!input_key_get_mouse(&pd->s, m, m->x - pd->px, + m->y - pd->py, &buf, &len)) + return (0); + bufferevent_write(job_get_event(pd->job), buf, len); + return (0); + } input_key(NULL, &pd->s, job_get_event(pd->job), event->key); return (0); }