From f9bd5eb79ea3e406acf04405476e53d31ad0c450 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 26 May 2026 12:48:16 +0100 Subject: [PATCH] If a pane is outside the window, treat as obscured. --- screen-write.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/screen-write.c b/screen-write.c index 6bd3fe90..42daed2e 100644 --- a/screen-write.c +++ b/screen-write.c @@ -191,7 +191,15 @@ screen_write_pane_is_obscured(struct screen_write_ctx *ctx) } ctx->flags |= SCREEN_WRITE_CHECKED_IF_OBSCURED; - while ((wp = TAILQ_PREV(wp, window_panes, zentry)) != NULL) { + if (ctx->wp->xoff < 0 || + ctx->wp->yoff < 0 || + ctx->wp->xoff + ctx->wp->sx >= ctx->wp->window->sx || + ctx->wp->yoff + ctx->wp->sy >= ctx->wp->window->sy) { + ctx->flags |= SCREEN_WRITE_OBSCURED; + return (1); + } + + while ((wp = TAILQ_PREV(wp, window_panes, zentry)) != NULL) { if ((wp->flags & PANE_FLOATING) && ((wp->yoff >= ctx->wp->yoff && wp->yoff <= ctx->wp->yoff + (int)ctx->wp->sy) ||