Implement "all event" (1003) mouse mode but in a way that works. The

main issue is that if we have two panes, A with 1002 and B with 1003, we
need to set 1003 outside tmux in order to get all the mouse events, but
then we need to suppress the ones that pane A doesn't want. This is easy
in SGR mouse mode, because buttons == 3 is only used for movement events
(for other events the trailing m/M marks a release instead), but in
normal mouse mode we can't tell so easily. So for that, look at the
previous event instead - if it is drag+release as well, then the current
event is a movement event.
This commit is contained in:
nicm
2017-02-01 09:55:07 +00:00
parent 3408595f77
commit dd0c814779
8 changed files with 89 additions and 19 deletions

8
tty.c
View File

@ -568,12 +568,16 @@ tty_update_mode(struct tty *tty, int mode, struct screen *s)
* it is safe from misinterpretation.
*/
tty_puts(tty, "\033[?1006h");
if (mode & MODE_MOUSE_BUTTON)
if (mode & MODE_MOUSE_ALL)
tty_puts(tty, "\033[?1003h");
else if (mode & MODE_MOUSE_BUTTON)
tty_puts(tty, "\033[?1002h");
else if (mode & MODE_MOUSE_STANDARD)
tty_puts(tty, "\033[?1000h");
} else {
if (tty->mode & MODE_MOUSE_BUTTON)
if (tty->mode & MODE_MOUSE_ALL)
tty_puts(tty, "\033[?1003l");
else if (tty->mode & MODE_MOUSE_BUTTON)
tty_puts(tty, "\033[?1002l");
else if (tty->mode & MODE_MOUSE_STANDARD)
tty_puts(tty, "\033[?1000l");