summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/screen-write.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2021-10-25 09:22:18 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2021-10-25 09:22:18 +0000
commitb0483ad533c87cd6775fe233ae9fc187f7f9fdc8 (patch)
tree0fd6b167acd49a5e683012dd9260cb0acc0436ec /usr.bin/tmux/screen-write.c
parentf11c350767e59b44f00b39c6bdd75cbec5e07ed3 (diff)
Instead of setting the popup default colours in the draw callback, set
it up in popup_display and follow the same routine as panes in the draw and init_ctx callbacks - use the palette if the option value is default. Allows application-set fg and bg to work in panes again.
Diffstat (limited to 'usr.bin/tmux/screen-write.c')
-rw-r--r--usr.bin/tmux/screen-write.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c
index 43184034dd6..80050437dbc 100644
--- a/usr.bin/tmux/screen-write.c
+++ b/usr.bin/tmux/screen-write.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen-write.c,v 1.202 2021/10/20 09:50:40 nicm Exp $ */
+/* $OpenBSD: screen-write.c,v 1.203 2021/10/25 09:22:17 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -184,8 +184,10 @@ screen_write_initctx(struct screen_write_ctx *ctx, struct tty_ctx *ttyctx,
if (ctx->init_ctx_cb != NULL) {
ctx->init_ctx_cb(ctx, ttyctx);
if (ttyctx->palette != NULL) {
- ttyctx->defaults.fg = ttyctx->palette->fg;
- ttyctx->defaults.bg = ttyctx->palette->bg;
+ if (COLOUR_DEFAULT(ttyctx->defaults.fg))
+ ttyctx->defaults.fg = ttyctx->palette->fg;
+ if (COLOUR_DEFAULT(ttyctx->defaults.bg))
+ ttyctx->defaults.bg = ttyctx->palette->bg;
}
} else {
ttyctx->redraw_cb = screen_write_redraw_cb;