From 268a2efb16401b53f02bbdba3038670b7fd1b8d0 Mon Sep 17 00:00:00 2001 From: Tiago Cunha Date: Thu, 5 May 2011 10:12:33 +0000 Subject: [PATCH] Sync OpenBSD patchset 903: Change window with mouse wheel over status line if mouse-select-window is on, from marcel partap. --- server-client.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/server-client.c b/server-client.c index 08654131..8e54fd33 100644 --- a/server-client.c +++ b/server-client.c @@ -1,4 +1,4 @@ -/* $Id: server-client.c,v 1.58 2011-05-05 10:03:05 tcunha Exp $ */ +/* $Id: server-client.c,v 1.59 2011-05-05 10:12:33 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -324,11 +324,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;