Sync OpenBSD patchset 373:

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:
Tiago Cunha
2009-10-11 23:46:02 +00:00
parent 2486a36af3
commit ea1721bcb0
6 changed files with 48 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.111 2009-10-11 23:38:16 tcunha Exp $ */
/* $Id: window.c,v 1.112 2009-10-11 23:46:02 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -302,6 +302,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)
{