From 4658c063d59bab42ccca8c2e58a50800b00b956f Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sat, 10 Oct 2009 14:51:16 +0000 Subject: 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. --- window.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'window.c') diff --git a/window.c b/window.c index 24d74fd2..71e09b52 100644 --- a/window.c +++ b/window.c @@ -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) { -- cgit