From e242da168bb6d50c687ccd1897b82c1d282a651a Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 9 Jul 2026 07:32:58 +0000 Subject: [PATCH] Clip the status line and menu against an open popup overlay, GitHub issue 5350 from Noam Stolero. --- popup.c | 2 +- screen-redraw.c | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/popup.c b/popup.c index 72a8259cb..913c6c527 100644 --- a/popup.c +++ b/popup.c @@ -245,7 +245,7 @@ popup_check_cb(struct client* c, void *data, u_int px, u_int py, u_int nx) */ for (i = 0; i < mr->used; i++) { server_client_overlay_range(pd->px, pd->py, pd->sx, - pd->sy, r->ranges[i].px, py, r->ranges[i].nx, + pd->sy, mr->ranges[i].px, py, mr->ranges[i].nx, &pd->or[i]); } diff --git a/screen-redraw.c b/screen-redraw.c index 6e8b65b76..70a830e6a 100644 --- a/screen-redraw.c +++ b/screen-redraw.c @@ -1588,8 +1588,10 @@ redraw_draw(struct client *c, struct window_pane *wp, int flags) struct screen *sl; struct redraw_scene *scene; struct window_pane *loop; - u_int width, i, y, lines; + u_int width, i, y, lines, j; struct redraw_span *first; + struct visible_ranges *r; + struct visible_range *rr; int redraw; if (c->flags & CLIENT_SUSPENDED) @@ -1694,8 +1696,16 @@ redraw_draw(struct client *c, struct window_pane *wp, int flags) else y = c->tty.sy - lines; sl = c->status.active; - for (i = 0; i < lines; i++) - tty_draw_line(tty, sl, 0, i, UINT_MAX, 0, y + i, NULL); + for (i = 0; i < lines; i++) { + r = tty_check_overlay_range(tty, 0, y + i, tty->sx); + for (j = 0; j < r->used; j++) { + rr = &r->ranges[j]; + if (rr->nx == 0) + continue; + tty_draw_line(tty, sl, rr->px, i, rr->nx, + rr->px, y + i, NULL); + } + } } if (c->overlay_draw != NULL && (flags & REDRAW_OVERLAY)) c->overlay_draw(c, c->overlay_data);