-/* $OpenBSD: screen-redraw.c,v 1.98 2024/08/26 07:34:40 nicm Exp $ */
+/* $OpenBSD: screen-redraw.c,v 1.99 2024/10/08 09:40:50 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
struct client *c = ctx->c;
struct window *w = c->session->curw->window;
struct window_pane *wp;
+ u_int sy = w->sy;
+
+ if (ctx->pane_status == PANE_STATUS_BOTTOM)
+ sy--;
/* Outside the window? */
- if (px > w->sx || py > w->sy)
+ if (px > w->sx || py > sy)
return (0);
/* On the window border? */
- if (px == w->sx || py == w->sy)
+ if (px == w->sx || py == sy)
return (1);
/* Check all the panes. */
u_int sx = w->sx, sy = w->sy;
int borders = 0;
+ if (pane_status == PANE_STATUS_BOTTOM)
+ sy--;
+
/* Is this outside the window? */
if (px > sx || py > sy)
return (CELL_OUTSIDE);
if (py == 0 ||
screen_redraw_cell_border(ctx, px, py - 1))
borders |= 2;
- if (py != sy - 1 &&
+ if (py != sy &&
screen_redraw_cell_border(ctx, px, py + 1))
borders |= 1;
} else {
struct window *w = c->session->curw->window;
struct window_pane *wp, *active;
int pane_status = ctx->pane_status;
+ u_int sx = w->sx, sy = w->sy;
int border;
u_int right, line;
*wpp = NULL;
- if (px > w->sx || py > w->sy)
+ if (px > sx || py > sy)
return (CELL_OUTSIDE);
- if (px == w->sx || py == w->sy) /* window border */
+ if (px == sx || py == sy) /* window border */
return (screen_redraw_type_of_cell(ctx, px, py));
if (pane_status != PANE_STATUS_OFF) {
if (pane_status == PANE_STATUS_TOP)
line = wp->yoff - 1;
else
- line = wp->yoff + wp->sy;
+ line = wp->yoff + sy;
right = wp->xoff + 2 + wp->status_size - 1;
if (py == line && px >= wp->xoff + 2 && px <= right)
if (flags & (CLIENT_REDRAWWINDOW|CLIENT_REDRAWBORDERS)) {
log_debug("%s: redrawing borders", c->name);
+ screen_redraw_draw_borders(&ctx);
if (ctx.pane_status != PANE_STATUS_OFF)
screen_redraw_draw_pane_status(&ctx);
- screen_redraw_draw_borders(&ctx);
}
if (flags & CLIENT_REDRAWWINDOW) {
log_debug("%s: redrawing panes", c->name);