diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-28 19:52:21 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-01-28 19:52:21 +0000 |
commit | 4428987e955da1c56d1fcd98d2130f6a02738f1a (patch) | |
tree | c17e6a8d9d907c28c39039346cf99d54a3cf4b93 /window.c | |
parent | 70024b3685126195994313790c26359236889485 (diff) | |
download | rtmux-4428987e955da1c56d1fcd98d2130f6a02738f1a.tar.gz rtmux-4428987e955da1c56d1fcd98d2130f6a02738f1a.tar.bz2 rtmux-4428987e955da1c56d1fcd98d2130f6a02738f1a.zip |
* Better support for at least the most common variant of mouse input: parse it and adjust for different panes. Also support mouse in window/session choice mode.
* Bring back the fancy window titles with session/window names: it is easy to work around problems with elinks (see FAQ).
Diffstat (limited to 'window.c')
-rw-r--r-- | window.c | 26 |
1 files changed, 22 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.63 2009-01-26 22:57:20 nicm Exp $ */ +/* $Id: window.c,v 1.64 2009-01-28 19:52:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -659,8 +659,26 @@ window_pane_parse(struct window_pane *wp) void window_pane_key(struct window_pane *wp, struct client *c, int key) { - if (wp->mode != NULL) - wp->mode->key(wp, c, key); - else + if (wp->mode != NULL) { + if (wp->mode->key != NULL) + wp->mode->key(wp, c, key); + } else input_key(wp, key); } + +void +window_pane_mouse( + struct window_pane *wp, struct client *c, u_char b, u_char x, u_char y) +{ + /* XXX convert from 1-based? */ + + if (y < wp->yoff || y >= wp->yoff + wp->sy) + return; + y -= wp->yoff; + + if (wp->mode != NULL) { + if (wp->mode->mouse != NULL) + wp->mode->mouse(wp, c, b, x, y); + } else + input_mouse(wp, b, x, y); +} |