New option, mouse-select-pane. If on, the mouse may be used to select the

current pane.

Suggested by sthen@ and also by someone else ages ago who I have forgotten.
This commit is contained in:
Nicholas Marriott
2009-10-10 14:51:16 +00:00
parent 3a20a05a49
commit 4658c063d5
6 changed files with 42 additions and 3 deletions

View File

@ -304,6 +304,23 @@ window_set_active_pane(struct window *w, struct window_pane *wp)
}
}
void
window_set_active_at(struct window *w, u_int x, u_int y)
{
struct window_pane *wp;
TAILQ_FOREACH(wp, &w->panes, entry) {
if (!window_pane_visible(wp))
continue;
if (x < wp->xoff || x >= wp->xoff + wp->sx)
continue;
if (y < wp->yoff || y >= wp->yoff + wp->sy)
continue;
window_set_active_pane(w, wp);
break;
}
}
struct window_pane *
window_add_pane(struct window *w, u_int hlimit)
{