diff options
author | nicm <nicm> | 2022-10-25 09:04:49 +0000 |
---|---|---|
committer | nicm <nicm> | 2022-10-25 09:04:49 +0000 |
commit | 0fc961b22ee6c7298e8dd40d3ce8e2b484bc6b1d (patch) | |
tree | eba441146348a9d2904989ba08805e9e3d3e62cf /screen-write.c | |
parent | ff2766b024e6657b5f5f70dfd5acdb32085d7b70 (diff) |
Do not fire redraw callback if NULL.
Diffstat (limited to 'screen-write.c')
-rw-r--r-- | screen-write.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/screen-write.c b/screen-write.c index 476fe4dd..a2107f2a 100644 --- a/screen-write.c +++ b/screen-write.c @@ -1505,8 +1505,10 @@ screen_write_fullredraw(struct screen_write_ctx *ctx) screen_write_collect_flush(ctx, 0, __func__); - screen_write_initctx(ctx, &ttyctx, 1); - ttyctx.redraw_cb(&ttyctx); + if (ttyctx.redraw_cb != NULL) { + screen_write_initctx(ctx, &ttyctx, 1); + ttyctx.redraw_cb(&ttyctx); + } } /* Trim collected items. */ @@ -2127,8 +2129,10 @@ screen_write_alternateon(struct screen_write_ctx *ctx, struct grid_cell *gc, screen_write_collect_flush(ctx, 0, __func__); screen_alternate_on(ctx->s, gc, cursor); - screen_write_initctx(ctx, &ttyctx, 1); - ttyctx.redraw_cb(&ttyctx); + if (ttyctx.redraw_cb != NULL) { + screen_write_initctx(ctx, &ttyctx, 1); + ttyctx.redraw_cb(&ttyctx); + } } /* Turn alternate screen off. */ @@ -2145,6 +2149,8 @@ screen_write_alternateoff(struct screen_write_ctx *ctx, struct grid_cell *gc, screen_write_collect_flush(ctx, 0, __func__); screen_alternate_off(ctx->s, gc, cursor); - screen_write_initctx(ctx, &ttyctx, 1); - ttyctx.redraw_cb(&ttyctx); + if (ttyctx.redraw_cb != NULL) { + screen_write_initctx(ctx, &ttyctx, 1); + ttyctx.redraw_cb(&ttyctx); + } } |