summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/window.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-10-10 14:51:16 +0000
committernicm <nicm@openbsd.org>2009-10-10 14:51:16 +0000
commit6f0d6ace4fa43a81c13c472e1ee64cc6564e15ca (patch)
treed2a96e59d7e4ef3c86cbd311988b602ab1326e2e /usr.bin/tmux/window.c
parentdon't use a references to the device file to check the current mode (diff)
downloadwireguard-openbsd-6f0d6ace4fa43a81c13c472e1ee64cc6564e15ca.tar.xz
wireguard-openbsd-6f0d6ace4fa43a81c13c472e1ee64cc6564e15ca.zip
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.
Diffstat (limited to 'usr.bin/tmux/window.c')
-rw-r--r--usr.bin/tmux/window.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c
index b80cec3aed3..6aa4dccb9f3 100644
--- a/usr.bin/tmux/window.c
+++ b/usr.bin/tmux/window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window.c,v 1.28 2009/10/10 10:02:48 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.29 2009/10/10 14:51:16 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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)
{