Add an option (mouse-select-window) which allows the mouse to be used by

clicking on the status line, written by hsim at gmx dot li.
This commit is contained in:
Nicholas Marriott
2011-04-18 19:49:05 +00:00
parent 4e75e82cc3
commit 0bb2119781
5 changed files with 41 additions and 0 deletions

View File

@ -319,6 +319,12 @@ 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 &&
options_get_number(oo, "mouse-select-window") &&
options_get_number(oo, "status")) {
status_set_window_at(c, mouse->x);
return;
}
window_pane_mouse(wp, c->session, mouse);
return;
}
@ -459,6 +465,10 @@ server_client_reset_state(struct client *c)
(mode & ALL_MOUSE_MODES) == 0)
mode |= MODE_MOUSE_STANDARD;
if (options_get_number(oo, "mouse-select-window") &&
(mode & ALL_MOUSE_MODES) == 0)
mode |= MODE_MOUSE_STANDARD;
/*
* Set UTF-8 mouse input if required. If the terminal is UTF-8, the
* user has set mouse-utf8 and any mouse mode is in effect, turn on