diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2011-01-15 00:46:19 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2011-01-15 00:46:19 +0000 |
commit | 3de1700f616a60a7c7d15a66b0637012b5cdb00a (patch) | |
tree | 1a0c618a9431854cd625d17bd3676bb1c57da57f | |
parent | 8f8e81c0c9a39b2977e3b2737d4825ab00bef52a (diff) | |
download | rtmux-3de1700f616a60a7c7d15a66b0637012b5cdb00a.tar.gz rtmux-3de1700f616a60a7c7d15a66b0637012b5cdb00a.tar.bz2 rtmux-3de1700f616a60a7c7d15a66b0637012b5cdb00a.zip |
Only set a mouse mode for mouse-select-pane if none already set by the
mode (any will do).
-rw-r--r-- | server-client.c | 7 | ||||
-rw-r--r-- | tty.c | 16 |
2 files changed, 14 insertions, 9 deletions
diff --git a/server-client.c b/server-client.c index 055f192c..9b83fe13 100644 --- a/server-client.c +++ b/server-client.c @@ -449,9 +449,14 @@ server_client_reset_state(struct client *c) else tty_cursor(&c->tty, wp->xoff + s->cx, wp->yoff + s->cy); + /* + * Any mode will do for mouse-select-pane, but set standard mode if + * none. + */ mode = s->mode; if (TAILQ_NEXT(TAILQ_FIRST(&w->panes), entry) != NULL && - options_get_number(oo, "mouse-select-pane")) + options_get_number(oo, "mouse-select-pane") && + (mode & ALL_MOUSE_MODES) == 0) mode |= MODE_MOUSE_STANDARD; /* @@ -401,19 +401,19 @@ tty_update_mode(struct tty *tty, int mode) if (mode & ALL_MOUSE_MODES) { if (mode & MODE_MOUSE_UTF8) tty_puts(tty, "\033[?1005h"); - if (mode & MODE_MOUSE_STANDARD) - tty_puts(tty, "\033[?1000h"); + if (mode & MODE_MOUSE_ANY) + tty_puts(tty, "\033[?1003h"); else if (mode & MODE_MOUSE_BUTTON) tty_puts(tty, "\033[?1002h"); - else if (mode & MODE_MOUSE_ANY) - tty_puts(tty, "\033[?1003h"); + else if (mode & MODE_MOUSE_STANDARD) + tty_puts(tty, "\033[?1000h"); } else { - if (tty->mode & MODE_MOUSE_STANDARD) - tty_puts(tty, "\033[?1000l"); + if (tty->mode & MODE_MOUSE_ANY) + tty_puts(tty, "\033[?1003l"); else if (tty->mode & MODE_MOUSE_BUTTON) tty_puts(tty, "\033[?1002l"); - else if (tty->mode & MODE_MOUSE_ANY) - tty_puts(tty, "\033[?1003l"); + else if (tty->mode & MODE_MOUSE_STANDARD) + tty_puts(tty, "\033[?1000l"); if (tty->mode & MODE_MOUSE_UTF8) tty_puts(tty, "\033[?1005l"); } |