diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2021-10-11 13:27:51 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2021-10-11 13:27:51 +0000 |
commit | 9005ab924af56df5945d74d8db7d9ba3d48f57b7 (patch) | |
tree | e8c3bb7b75a94fdc5786307d0509539449bba557 /usr.bin/tmux/menu.c | |
parent | 0438c56b034e2c55a51d27f64912e3ee08720cf2 (diff) |
Make positions hidden by overlays range-based rather than character-based,
from Anindya Mukherjee.
Diffstat (limited to 'usr.bin/tmux/menu.c')
-rw-r--r-- | usr.bin/tmux/menu.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/usr.bin/tmux/menu.c b/usr.bin/tmux/menu.c index 0a1fa0da60e..5eb90534d9e 100644 --- a/usr.bin/tmux/menu.c +++ b/usr.bin/tmux/menu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: menu.c,v 1.37 2021/09/09 19:37:17 nicm Exp $ */ +/* $OpenBSD: menu.c,v 1.38 2021/10/11 13:27:50 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -140,17 +140,16 @@ menu_mode_cb(__unused struct client *c, void *data, __unused u_int *cx, return (&md->s); } -int -menu_check_cb(__unused struct client *c, void *data, u_int px, u_int py) +/* Return parts of the input range which are not obstructed by the menu. */ +void +menu_check_cb(__unused struct client *c, void *data, u_int px, u_int py, + u_int nx, struct overlay_ranges *r) { struct menu_data *md = data; struct menu *menu = md->menu; - if (px < md->px || px > md->px + menu->width + 3) - return (1); - if (py < md->py || py > md->py + menu->count + 1) - return (1); - return (0); + server_client_overlay_range(md->px, md->py, menu->width + 4, + menu->count + 2, px, py, nx, r); } void |