diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-10-11 07:01:10 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-10-11 07:01:10 +0000 |
commit | 4bc0f6e7e9eac73f7a1221ed4c2854d12eb1cf7e (patch) | |
tree | 2bafaa9c2cb171ff453fa7069ddc4286051f3e28 /window-copy.c | |
parent | f68ade7b1d1c3aa74a11a5eeed35ea409d5d63c7 (diff) | |
download | rtmux-4bc0f6e7e9eac73f7a1221ed4c2854d12eb1cf7e.tar.gz rtmux-4bc0f6e7e9eac73f7a1221ed4c2854d12eb1cf7e.tar.bz2 rtmux-4bc0f6e7e9eac73f7a1221ed4c2854d12eb1cf7e.zip |
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 'window-copy.c')
-rw-r--r-- | window-copy.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/window-copy.c b/window-copy.c index 0f497f87..2eb91acb 100644 --- a/window-copy.c +++ b/window-copy.c @@ -29,7 +29,7 @@ void window_copy_resize(struct window_pane *, u_int, u_int); void window_copy_key(struct window_pane *, struct client *, int); int window_copy_key_input(struct window_pane *, int); void window_copy_mouse( - struct window_pane *, struct client *, u_char, u_char, u_char); + struct window_pane *, struct client *, struct mouse_event *); void window_copy_redraw_lines(struct window_pane *, u_int, u_int); void window_copy_redraw_screen(struct window_pane *); @@ -418,20 +418,20 @@ window_copy_key_input(struct window_pane *wp, int key) } void -window_copy_mouse(struct window_pane *wp, - unused struct client *c, u_char b, u_char x, u_char y) +window_copy_mouse( + struct window_pane *wp, unused struct client *c, struct mouse_event *m) { struct window_copy_mode_data *data = wp->modedata; struct screen *s = &data->screen; - if ((b & 3) == 3) + if ((m->b & 3) == 3) return; - if (x >= screen_size_x(s)) + if (m->x >= screen_size_x(s)) return; - if (y >= screen_size_y(s)) + if (m->y >= screen_size_y(s)) return; - window_copy_update_cursor(wp, x, y); + window_copy_update_cursor(wp, m->x, m->y); if (window_copy_update_selection(wp)) window_copy_redraw_screen(wp); } |