diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2011-05-04 18:10:29 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2011-05-04 18:10:29 +0000 |
commit | b839f913a16554f130408ae674cc27e903cb1f05 (patch) | |
tree | 7c2fc00752598ea13d02f83f98a8d4dc20fed2be /usr.bin | |
parent | 13424e75a1f2cd3bad93e10e25b756a7832872d5 (diff) |
Change window with mouse wheel over status line if mouse-select-window
is on, from marcel partap.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/server-client.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 21d196143b1..4ceafd136c2 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.55 2011/05/04 17:40:32 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.56 2011/05/04 18:10:28 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -325,11 +325,24 @@ server_client_handle_key(int key, struct mouse_event *mouse, void *data) server_redraw_window_borders(w); wp = w->active; } - if (mouse->y + 1 == c->tty.sy && mouse->b == MOUSE_UP && + if (mouse->y + 1 == c->tty.sy && options_get_number(oo, "mouse-select-window") && options_get_number(oo, "status")) { - status_set_window_at(c, mouse->x); - return; + if (mouse->b == MOUSE_UP) { + status_set_window_at(c, mouse->x); + return; + } + if (mouse->b & MOUSE_45) { + if ((mouse->b & MOUSE_BUTTON) == MOUSE_1) { + session_previous(c->session, 0); + server_redraw_session(s); + } + if ((mouse->b & MOUSE_BUTTON) == MOUSE_2) { + session_next(c->session, 0); + server_redraw_session(s); + } + return; + } } window_pane_mouse(wp, c->session, mouse); return; |