Sync OpenBSD patchset 846:

Only set a mouse mode for mouse-select-pane if none already set by the
mode (any will do).
This commit is contained in:
Tiago Cunha 2011-01-21 23:56:53 +00:00
parent 332bfbf273
commit 1930181b18
2 changed files with 16 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $Id: server-client.c,v 1.52 2011-01-21 23:44:13 tcunha Exp $ */
/* $Id: server-client.c,v 1.53 2011-01-21 23:56:53 tcunha Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -448,9 +448,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;
/*

18
tty.c
View File

@ -1,4 +1,4 @@
/* $Id: tty.c,v 1.201 2011-01-21 23:56:11 tcunha Exp $ */
/* $Id: tty.c,v 1.202 2011-01-21 23:56:53 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -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");
}