Merge branch 'master' into floating_panes

This commit is contained in:
Nicholas Marriott
2026-05-22 10:40:29 +01:00
4 changed files with 78 additions and 69 deletions

67
tty.c
View File

@@ -1118,7 +1118,7 @@ tty_is_visible(__unused struct tty *tty, const struct tty_ctx *ctx, u_int px,
{
u_int xoff = ctx->rxoff + px, yoff = ctx->ryoff + py;
if (!ctx->bigger)
if (~ctx->flags & TTY_CTX_WINDOW_BIGGER)
return (1);
if (xoff + nx <= ctx->wox || xoff >= ctx->wox + ctx->wsx ||
@@ -1429,9 +1429,9 @@ tty_draw_pane(struct tty *tty, const struct tty_ctx *ctx, u_int py)
struct visible_range *ri;
u_int nx = ctx->sx, i, px, x, rx, ry;
log_debug("%s: %s %u %d", __func__, tty->client->name, py, ctx->bigger);
log_debug("%s: %s %u", __func__, tty->client->name, py);
if (!ctx->bigger) {
if (~ctx->flags & TTY_CTX_WINDOW_BIGGER) {
if (wp) {
if (ctx->obscured) {
/*
@@ -1644,7 +1644,7 @@ tty_client_ready(const struct tty_ctx *ctx, struct client *c)
* If invisible panes are allowed (used for passthrough), don't care if
* redrawing or frozen.
*/
if (ctx->allow_invisible_panes)
if (ctx->flags & TTY_CTX_INVISIBLE_PANES)
return (1);
if (c->flags & CLIENT_REDRAWWINDOW)
@@ -1693,7 +1693,7 @@ tty_cmd_insertcharacter(struct tty *tty, const struct tty_ctx *ctx)
{
struct client *c = tty->client;
if (ctx->bigger ||
if ((ctx->flags & TTY_CTX_WINDOW_BIGGER) ||
!tty_full_width(tty, ctx) ||
tty_fake_bce(tty, &ctx->defaults, ctx->bg) ||
(!tty_term_has(tty->term, TTYC_ICH) &&
@@ -1717,7 +1717,7 @@ tty_cmd_deletecharacter(struct tty *tty, const struct tty_ctx *ctx)
{
struct client *c = tty->client;
if (ctx->bigger ||
if ((ctx->flags & TTY_CTX_WINDOW_BIGGER) ||
!tty_full_width(tty, ctx) ||
tty_fake_bce(tty, &ctx->defaults, ctx->bg) ||
(!tty_term_has(tty->term, TTYC_DCH) &&
@@ -1750,7 +1750,7 @@ tty_cmd_insertline(struct tty *tty, const struct tty_ctx *ctx)
{
struct client *c = tty->client;
if (ctx->bigger ||
if ((ctx->flags & TTY_CTX_WINDOW_BIGGER) ||
!tty_full_width(tty, ctx) ||
tty_fake_bce(tty, &ctx->defaults, ctx->bg) ||
!tty_term_has(tty->term, TTYC_CSR) ||
@@ -1779,7 +1779,7 @@ tty_cmd_deleteline(struct tty *tty, const struct tty_ctx *ctx)
{
struct client *c = tty->client;
if (ctx->bigger ||
if ((ctx->flags & TTY_CTX_WINDOW_BIGGER) ||
!tty_full_width(tty, ctx) ||
tty_fake_bce(tty, &ctx->defaults, ctx->bg) ||
!tty_term_has(tty->term, TTYC_CSR) ||
@@ -1840,7 +1840,7 @@ tty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx)
if (ctx->ocy != ctx->orupper)
return;
if (ctx->bigger ||
if ((ctx->flags & TTY_CTX_WINDOW_BIGGER) ||
(!tty_full_width(tty, ctx) && !tty_use_margin(tty)) ||
tty_fake_bce(tty, &ctx->defaults, 8) ||
!tty_term_has(tty->term, TTYC_CSR) ||
@@ -1874,7 +1874,7 @@ tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx)
if (ctx->ocy != ctx->orlower)
return;
if (ctx->bigger ||
if ((ctx->flags & TTY_CTX_WINDOW_BIGGER) ||
(!tty_full_width(tty, ctx) && !tty_use_margin(tty)) ||
tty_fake_bce(tty, &ctx->defaults, 8) ||
!tty_term_has(tty->term, TTYC_CSR) ||
@@ -1915,7 +1915,7 @@ tty_cmd_scrollup(struct tty *tty, const struct tty_ctx *ctx)
struct client *c = tty->client;
u_int i;
if (ctx->bigger ||
if ((ctx->flags & TTY_CTX_WINDOW_BIGGER) ||
(!tty_full_width(tty, ctx) && !tty_use_margin(tty)) ||
tty_fake_bce(tty, &ctx->defaults, 8) ||
!tty_term_has(tty->term, TTYC_CSR) ||
@@ -1955,7 +1955,7 @@ tty_cmd_scrolldown(struct tty *tty, const struct tty_ctx *ctx)
u_int i;
struct client *c = tty->client;
if (ctx->bigger ||
if ((ctx->flags & TTY_CTX_WINDOW_BIGGER) ||
(!tty_full_width(tty, ctx) && !tty_use_margin(tty)) ||
tty_fake_bce(tty, &ctx->defaults, 8) ||
!tty_term_has(tty->term, TTYC_CSR) ||
@@ -2058,7 +2058,7 @@ tty_cmd_alignmenttest(struct tty *tty, const struct tty_ctx *ctx)
{
u_int i, j;
if (ctx->bigger) {
if (ctx->flags & TTY_CTX_WINDOW_BIGGER) {
ctx->redraw_cb(ctx);
return;
}
@@ -2090,7 +2090,7 @@ tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx)
(gcp->data.width == 1 && !tty_check_overlay(tty, px, py)))
return;
if (ctx->num == 2) {
if (ctx->flags & TTY_CTX_CELL_DRAW_LINE) {
tty_draw_line(tty, s, 0, s->cy, screen_size_x(s),
ctx->xoff - ctx->wox, py, &ctx->defaults, ctx->palette);
return;
@@ -2120,7 +2120,7 @@ tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx)
tty_cell(tty, ctx->cell, &ctx->defaults, ctx->palette,
ctx->s->hyperlinks);
if (ctx->num == 1)
if (ctx->flags & TTY_CTX_CELL_INVALIDATE)
tty_invalidate(tty);
}
@@ -2135,10 +2135,10 @@ tty_cmd_cells(struct tty *tty, const struct tty_ctx *ctx)
if (!tty_is_visible(tty, ctx, ctx->ocx, ctx->ocy, ctx->num, 1))
return;
if (ctx->bigger &&
if ((ctx->flags & TTY_CTX_WINDOW_BIGGER) &&
(ctx->xoff + ctx->ocx < ctx->wox ||
ctx->xoff + ctx->ocx + ctx->num > ctx->wox + ctx->wsx)) {
if (!ctx->wrapped ||
if ((~ctx->flags & TTY_CTX_WRAPPED) ||
!tty_full_width(tty, ctx) ||
(tty->term->flags & TERM_NOAM) ||
ctx->xoff + ctx->ocx != 0 ||
@@ -2401,20 +2401,23 @@ tty_cmd_sixelimage(struct tty *tty, const struct tty_ctx *ctx)
void
tty_cmd_syncstart(struct tty *tty, const struct tty_ctx *ctx)
{
if (ctx->num == 0x11) {
/*
* This is an overlay and a command that moves the cursor so
* start synchronized updates.
*/
tty_sync_start(tty);
} else if (~ctx->num & 0x10) {
/*
* This is a pane. If there is an overlay, always start;
* otherwise, only if requested.
*/
if (ctx->num || tty->client->overlay_draw != NULL)
tty_sync_start(tty);
}
struct client *c = tty->client;
if ((ctx->flags & TTY_CTX_OVERLAY_SYNC) &&
(ctx->flags & TTY_CTX_SYNC)) {
/*
* This is an overlay and a command that moves the cursor so
* start synchronized updates.
*/
tty_sync_start(tty);
} else if (~ctx->flags & TTY_CTX_OVERLAY_SYNC) {
/*
* This is a pane. If there is an overlay, always start;
* otherwise, only if requested.
*/
if ((ctx->flags & TTY_CTX_SYNC) || c->overlay_draw != NULL)
tty_sync_start(tty);
}
}
void
@@ -2593,7 +2596,7 @@ static void
tty_cursor_pane_unless_wrap(struct tty *tty, const struct tty_ctx *ctx,
u_int cx, u_int cy)
{
if (!ctx->wrapped ||
if ((~ctx->flags & TTY_CTX_WRAPPED) ||
!tty_full_width(tty, ctx) ||
(tty->term->flags & TERM_NOAM) ||
ctx->xoff + cx != 0 ||