config: add tweak.transparent_fullscreen=no|yes option

When enabled, the alpha channel will not be disabled when in
fullscreen state

Defaults to `no`
This commit is contained in:
Leonardo Hernández Hernández 2023-07-21 14:29:31 -06:00
parent f3d848da01
commit e41fafd985
No known key found for this signature in database
GPG key ID: E538897EE11B9624
4 changed files with 11 additions and 3 deletions

View file

@ -2569,6 +2569,9 @@ parse_section_tweak(struct context *ctx)
else if (streq(key, "bold-text-in-bright-amount")) else if (streq(key, "bold-text-in-bright-amount"))
return value_to_float(ctx, &conf->bold_in_bright.amount); return value_to_float(ctx, &conf->bold_in_bright.amount);
else if (strcmp(key, "transparent_fullscreen") == 0)
return value_to_bool(ctx, &conf->tweak.transparent_fullscreen);
else { else {
LOG_CONTEXTUAL_ERR("not a valid option: %s", key); LOG_CONTEXTUAL_ERR("not a valid option: %s", key);
return false; return false;
@ -3158,6 +3161,7 @@ config_load(struct config *conf, const char *conf_path,
.box_drawing_solid_shades = true, .box_drawing_solid_shades = true,
.font_monospace_warn = true, .font_monospace_warn = true,
.sixel = true, .sixel = true,
.transparent_fullscreen = false,
}, },
.touch = { .touch = {

View file

@ -368,6 +368,7 @@ struct config {
bool box_drawing_solid_shades; bool box_drawing_solid_shades;
bool font_monospace_warn; bool font_monospace_warn;
bool sixel; bool sixel;
bool transparent_fullscreen;
} tweak; } tweak;
struct { struct {

View file

@ -1507,6 +1507,10 @@ any of these options.
*bold-text-in-bright* is set to *yes* (the *palette-based* variant *bold-text-in-bright* is set to *yes* (the *palette-based* variant
is not affected by this option). Default: _1.3_. is not affected by this option). Default: _1.3_.
*transparent_fullscreen*
Boolean. When enabled, foot will not disable the alpha channel when
in fullscreen state. Default: _no_
# SEE ALSO # SEE ALSO
*foot*(1), *footclient*(1) *foot*(1), *footclient*(1)

View file

@ -538,7 +538,7 @@ render_cell(struct terminal *term, pixman_image_t *pix, pixman_region32_t *damag
} }
else if (cell->attrs.bg_src == COLOR_DEFAULT) { else if (cell->attrs.bg_src == COLOR_DEFAULT) {
if (term->window->is_fullscreen) { if (term->window->is_fullscreen && !term->conf->tweak.transparent_fullscreen) {
/* /*
* Note: disable transparency when fullscreened. * Note: disable transparency when fullscreened.
* *
@ -2900,8 +2900,7 @@ grid_render(struct terminal *term)
xassert(term->height > 0); xassert(term->height > 0);
struct buffer_chain *chain = term->render.chains.grid; struct buffer_chain *chain = term->render.chains.grid;
bool use_alpha = !term->window->is_fullscreen && bool use_alpha = term->colors.alpha != 0xffff;
term->colors.alpha != 0xffff;
struct buffer *buf = shm_get_buffer( struct buffer *buf = shm_get_buffer(
chain, term->width, term->height, use_alpha); chain, term->width, term->height, use_alpha);