Merged master into floating_panes

This commit is contained in:
Dane Jensen
2026-06-08 15:52:16 -07:00
58 changed files with 935 additions and 227 deletions

View File

@@ -627,21 +627,23 @@ screen_write_fast_copy(struct screen_write_ctx *ctx, struct screen *src,
struct grid_line *gl, *sgl;
struct grid_cell gc;
u_int xx, yy, cx = s->cx, cy = s->cy;
int yoff = 0;
int xoff = 0, yoff = 0;
struct visible_ranges *r;
if (nx == 0 || ny == 0)
return;
if (wp != NULL)
if (wp != NULL) {
xoff = wp->xoff;
yoff = wp->yoff;
}
for (yy = py; yy < py + ny; yy++) {
if (yy >= gd->hsize + gd->sy)
break;
s->cx = cx;
screen_write_initctx(ctx, &ttyctx, 0, 0);
r = screen_redraw_get_visible_ranges(wp, px, s->cy + yoff, nx,
NULL);
r = screen_redraw_get_visible_ranges(wp, xoff + s->cx,
s->cy + yoff, nx, NULL);
for (xx = px; xx < px + nx; xx++) {
gl = grid_get_line(gd, yy);
sgl = grid_get_line(s->grid, s->cy);
@@ -653,7 +655,7 @@ screen_write_fast_copy(struct screen_write_ctx *ctx, struct screen *src,
break;
grid_view_set_cell(s->grid, s->cx, s->cy, &gc);
if (!screen_redraw_is_visible(r, px))
if (!screen_redraw_is_visible(r, xoff + s->cx))
break;
ttyctx.cell = &gc;
ttyctx.flags &= (TTY_CTX_OVERLAY_SYNC|TTY_CTX_SYNC);
@@ -2925,16 +2927,22 @@ void
screen_write_alternateon(struct screen_write_ctx *ctx, struct grid_cell *gc,
int cursor)
{
struct tty_ctx ttyctx;
struct window_pane *wp = ctx->wp;
struct tty_ctx ttyctx;
struct window_pane *wp = ctx->wp;
struct window_pane_resize *r, *r1;
if (wp != NULL && !options_get_number(wp->options, "alternate-screen"))
return;
screen_write_collect_flush(ctx, 0, __func__);
screen_alternate_on(ctx->s, gc, cursor);
if (!screen_alternate_on(ctx->s, gc, cursor))
return;
if (wp != NULL) {
TAILQ_FOREACH_SAFE (r, &wp->resize_queue, entry, r1) {
TAILQ_REMOVE(&wp->resize_queue, r, entry);
free(r);
}
layout_fix_panes(wp->window, NULL);
server_redraw_window_borders(wp->window);
}
@@ -2956,7 +2964,8 @@ screen_write_alternateoff(struct screen_write_ctx *ctx, struct grid_cell *gc,
return;
screen_write_collect_flush(ctx, 0, __func__);
screen_alternate_off(ctx->s, gc, cursor);
if (!screen_alternate_off(ctx->s, gc, cursor))
return;
if (wp != NULL) {
layout_fix_panes(wp->window, NULL);