diff options
author | Tiago Cunha <tcunha@gmx.com> | 2012-05-22 21:05:30 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2012-05-22 21:05:30 +0000 |
commit | 17da2f7d5f16a20e70539248db9803ba3ac17350 (patch) | |
tree | 513cbc6fab671bf91d02a678160a34ccedae2dc2 /server-client.c | |
parent | fff7c0b2768523f6732e8d3fa409c431aadd7bfc (diff) |
Sync OpenBSD patchset 1121:
Store client in tty struct directly instead of using a callback function
pointer.
Diffstat (limited to 'server-client.c')
-rw-r--r-- | server-client.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/server-client.c b/server-client.c index 449190fd..d1f72397 100644 --- a/server-client.c +++ b/server-client.c @@ -26,9 +26,8 @@ #include "tmux.h" -void server_client_check_mouse(struct client *c, - struct window_pane *wp, struct mouse_event *mouse); -void server_client_handle_key(int, struct mouse_event *, void *); +void server_client_check_mouse(struct client *, struct window_pane *, + struct mouse_event *); void server_client_repeat_timer(int, short, void *); void server_client_check_exit(struct client *); void server_client_check_redraw(struct client *); @@ -337,9 +336,8 @@ server_client_check_mouse( /* Handle data key input from client. */ void -server_client_handle_key(int key, struct mouse_event *mouse, void *data) +server_client_handle_key(struct client *c, int key) { - struct client *c = data; struct session *s; struct window *w; struct window_pane *wp; @@ -390,7 +388,7 @@ server_client_handle_key(int key, struct mouse_event *mouse, void *data) if (key == KEYC_MOUSE) { if (c->flags & CLIENT_READONLY) return; - server_client_check_mouse(c, wp, mouse); + server_client_check_mouse(c, wp, &c->tty.mouse); return; } @@ -898,15 +896,13 @@ server_client_msg_identify( if (!isatty(fd)) return; data->term[(sizeof data->term) - 1] = '\0'; - tty_init(&c->tty, fd, data->term); + tty_init(&c->tty, c, fd, data->term); if (data->flags & IDENTIFY_UTF8) c->tty.flags |= TTY_UTF8; if (data->flags & IDENTIFY_256COLOURS) c->tty.term_flags |= TERM_256COLOURS; else if (data->flags & IDENTIFY_88COLOURS) c->tty.term_flags |= TERM_88COLOURS; - c->tty.key_callback = server_client_handle_key; - c->tty.key_data = c; tty_resize(&c->tty); |