summaryrefslogtreecommitdiffstats
path: root/server.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-10-11 07:01:10 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-10-11 07:01:10 +0000
commit4bc0f6e7e9eac73f7a1221ed4c2854d12eb1cf7e (patch)
tree2bafaa9c2cb171ff453fa7069ddc4286051f3e28 /server.c
parentf68ade7b1d1c3aa74a11a5eeed35ea409d5d63c7 (diff)
Clean up by introducing a wrapper struct for mouse clicks rather than passing
three u_chars around. As a side-effect this fixes incorrectly rejecting high cursor positions (because it was comparing them as signed char), reported by Tom Doherty.
Diffstat (limited to 'server.c')
-rw-r--r--server.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/server.c b/server.c
index c724d186..cff3db3b 100644
--- a/server.c
+++ b/server.c
@@ -880,9 +880,9 @@ server_handle_client(struct client *c)
struct timeval tv;
struct key_binding *bd;
struct keylist *keylist;
+ struct mouse_event mouse;
int key, status, xtimeout, mode, isprefix;
u_int i;
- u_char mouse[3];
xtimeout = options_get_number(&c->session->options, "repeat-time");
if (xtimeout != 0 && c->flags & CLIENT_REPEAT) {
@@ -894,7 +894,7 @@ server_handle_client(struct client *c)
/* Process keys. */
keylist = options_get_data(&c->session->options, "prefix");
- while (tty_keys_next(&c->tty, &key, mouse) == 0) {
+ while (tty_keys_next(&c->tty, &key, &mouse) == 0) {
if (c->session == NULL)
return;
@@ -922,10 +922,10 @@ server_handle_client(struct client *c)
/* Check for mouse keys. */
if (key == KEYC_MOUSE) {
if (options_get_number(oo, "mouse-select-pane")) {
- window_set_active_at(w, mouse[1], mouse[2]);
+ window_set_active_at(w, mouse.x, mouse.y);
wp = w->active;
}
- window_pane_mouse(wp, c, mouse[0], mouse[1], mouse[2]);
+ window_pane_mouse(wp, c, &mouse);
continue;
}