aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-05-01 06:09:08 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-05-01 08:18:14 +0000
commit7ced397089fb5724fb2021bea8491f361b289366 (patch)
treedd92547a335d23968fd34c9ce2ab9d333c86f524
parentchangelog: add new 'unreleased' section (diff)
config: gamma-correct-blending: disable by default
-rw-r--r--CHANGELOG.md4
-rw-r--r--config.c15
-rw-r--r--config.h4
-rw-r--r--doc/foot.ini.5.scd2
-rw-r--r--foot.ini1
-rw-r--r--render.c2
-rw-r--r--tests/test-config.c1
-rw-r--r--wayland.c6
8 files changed, 14 insertions, 21 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6bc5b9df..dd6300ae 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -65,6 +65,10 @@
## Unreleased
### Added
### Changed
+
+* `gamma-correct-blending` now defaults to `no` instead of `yes`.
+
+
### Deprecated
### Removed
### Fixed
diff --git a/config.c b/config.c
index 347cc1ec..c7cf03f9 100644
--- a/config.c
+++ b/config.c
@@ -1083,17 +1083,8 @@ parse_section_main(struct context *ctx)
return true;
}
- else if (streq(key, "gamma-correct-blending")) {
- bool gamma_correct;
- if (!value_to_bool(ctx, &gamma_correct))
- return false;
-
- conf->gamma_correct =
- gamma_correct
- ? GAMMA_CORRECT_ENABLED
- : GAMMA_CORRECT_DISABLED;
- return true;
- }
+ else if (streq(key, "gamma-correct-blending"))
+ return value_to_bool(ctx, &conf->gamma_correct);
else {
LOG_CONTEXTUAL_ERR("not a valid option: %s", key);
@@ -3318,7 +3309,7 @@ config_load(struct config *conf, const char *conf_path,
.underline_thickness = {.pt = 0., .px = -1},
.strikeout_thickness = {.pt = 0., .px = -1},
.dpi_aware = false,
- .gamma_correct = GAMMA_CORRECT_AUTO,
+ .gamma_correct = false,
.security = {
.osc52 = OSC52_ENABLED,
},
diff --git a/config.h b/config.h
index 2dec82c1..fe7a0331 100644
--- a/config.h
+++ b/config.h
@@ -168,9 +168,7 @@ struct config {
enum { STARTUP_WINDOWED, STARTUP_MAXIMIZED, STARTUP_FULLSCREEN } startup_mode;
bool dpi_aware;
- enum {GAMMA_CORRECT_DISABLED,
- GAMMA_CORRECT_ENABLED,
- GAMMA_CORRECT_AUTO} gamma_correct;
+ bool gamma_correct;
struct config_font_list fonts[4];
struct font_size_adjustment font_size_adjustment;
diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd
index 95e491eb..52a14524 100644
--- a/doc/foot.ini.5.scd
+++ b/doc/foot.ini.5.scd
@@ -227,7 +227,7 @@ empty string to be set, but it must be quoted: *KEY=""*)
though. The amount of errors can be reduced by using 10-bit
surfaces; see *tweak.surface-bit-depth*.
- Default: enabled when compositor support is available
+ Default: _no_.
*box-drawings-uses-font-glyphs*
Boolean. When disabled, foot generates box/line drawing characters
diff --git a/foot.ini b/foot.ini
index 7d96ca0f..2ac0c05e 100644
--- a/foot.ini
+++ b/foot.ini
@@ -22,6 +22,7 @@
# strikeout-thickness=<font strikeout thickness>
# box-drawings-uses-font-glyphs=no
# dpi-aware=no
+# gamma-correct-blending=no
# initial-window-size-pixels=700x500 # Or,
# initial-window-size-chars=<COLSxROWS>
diff --git a/render.c b/render.c
index b0d21d18..0ee60d65 100644
--- a/render.c
+++ b/render.c
@@ -5251,6 +5251,6 @@ render_xcursor_set(struct seat *seat, struct terminal *term,
bool
render_do_linear_blending(const struct terminal *term)
{
- return term->conf->gamma_correct != GAMMA_CORRECT_DISABLED &&
+ return term->conf->gamma_correct &&
term->wl->color_management.img_description != NULL;
}
diff --git a/tests/test-config.c b/tests/test-config.c
index 69d349b4..99398fec 100644
--- a/tests/test-config.c
+++ b/tests/test-config.c
@@ -468,6 +468,7 @@ test_section_main(void)
test_boolean(&ctx, &parse_section_main, "box-drawings-uses-font-glyphs", &conf.box_drawings_uses_font_glyphs);
test_boolean(&ctx, &parse_section_main, "locked-title", &conf.locked_title);
test_boolean(&ctx, &parse_section_main, "dpi-aware", &conf.dpi_aware);
+ test_boolean(&ctx, &parse_section_main, "gamma-correct-blending", &conf.gamma_correct);
test_pt_or_px(&ctx, &parse_section_main, "font-size-adjustment", &conf.font_size_adjustment.pt_or_px); /* TODO: test ‘N%’ values too */
test_pt_or_px(&ctx, &parse_section_main, "line-height", &conf.line_height);
diff --git a/wayland.c b/wayland.c
index 853124be..9b143508 100644
--- a/wayland.c
+++ b/wayland.c
@@ -1980,7 +1980,7 @@ wayl_win_init(struct terminal *term, const char *token)
xdg_toplevel_icon_v1_destroy(icon);
}
- if (term->conf->gamma_correct != GAMMA_CORRECT_DISABLED) {
+ if (term->conf->gamma_correct) {
if (wayl->color_management.img_description != NULL) {
xassert(wayl->color_management.manager != NULL);
@@ -1990,7 +1990,7 @@ wayl_win_init(struct terminal *term, const char *token)
wp_color_management_surface_v1_set_image_description(
win->surface.color_management, wayl->color_management.img_description,
WP_COLOR_MANAGER_V1_RENDER_INTENT_PERCEPTUAL);
- } else if (term->conf->gamma_correct == GAMMA_CORRECT_ENABLED) {
+ } else {
if (wayl->color_management.manager == NULL) {
LOG_WARN(
"gamma-corrected-blending: disabling; "
@@ -2005,8 +2005,6 @@ wayl_win_init(struct terminal *term, const char *token)
LOG_WARN(" - TF: ext_linear");
LOG_WARN(" - primaries: sRGB");
}
- } else {
- /* "auto" - don't warn */
}
}