diff options
author | Thomas Adam <thomas@xteddy.org> | 2021-08-17 10:01:19 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2021-08-17 10:01:19 +0100 |
commit | 0dad8dd98259ce686b98e482080d916edbc294e4 (patch) | |
tree | eb7453c7611567b2abf40e9832a08f0c9c8c95ef | |
parent | f2d4a1f02275e5b4f273a3228e0e9c099851dadd (diff) | |
parent | 41ababdf6c0529d4336a1daf3418ad314c373614 (diff) | |
download | rtmux-0dad8dd98259ce686b98e482080d916edbc294e4.tar.gz rtmux-0dad8dd98259ce686b98e482080d916edbc294e4.tar.bz2 rtmux-0dad8dd98259ce686b98e482080d916edbc294e4.zip |
Merge branch 'obsd-master' into master
-rw-r--r-- | screen-write.c | 17 | ||||
-rw-r--r-- | tty.c | 17 |
2 files changed, 29 insertions, 5 deletions
diff --git a/screen-write.c b/screen-write.c index 01f8a097..c09d09ab 100644 --- a/screen-write.c +++ b/screen-write.c @@ -197,9 +197,20 @@ screen_write_initctx(struct screen_write_ctx *ctx, struct tty_ctx *ttyctx, } } - if (ctx->wp != NULL && - (~ctx->flags & SCREEN_WRITE_SYNC) && - (sync || ctx->wp != ctx->wp->window->active)) { + if (~ctx->flags & SCREEN_WRITE_SYNC) { + /* + * For the active pane or for an overlay (no pane), we want to + * only use synchronized updates if requested (commands that + * move the cursor); for other panes, always use it, since the + * cursor will have to move. + */ + if (ctx->wp != NULL) { + if (ctx->wp != ctx->wp->window->active) + ttyctx->num = 1; + else + ttyctx->num = sync; + } else + ttyctx->num = 0x10|sync; tty_write(tty_cmd_syncstart, ttyctx); ctx->flags |= SCREEN_WRITE_SYNC; } @@ -2039,9 +2039,22 @@ tty_cmd_rawstring(struct tty *tty, const struct tty_ctx *ctx) } void -tty_cmd_syncstart(struct tty *tty, __unused const struct tty_ctx *ctx) +tty_cmd_syncstart(struct tty *tty, const struct tty_ctx *ctx) { - tty_sync_start(tty); + 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); + } } void |