Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package foot for openSUSE:Factory checked in 
at 2025-05-08 20:39:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/foot (Old)
 and      /work/SRC/openSUSE:Factory/.foot.new.30101 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "foot"

Thu May  8 20:39:57 2025 rev:44 rq:1275643 version:1.22.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/foot/foot.changes        2025-04-30 
19:05:37.077416750 +0200
+++ /work/SRC/openSUSE:Factory/.foot.new.30101/foot.changes     2025-05-08 
20:40:02.248621794 +0200
@@ -1,0 +2,13 @@
+Thu May  1 16:07:36 UTC 2025 - Arnav Singh <opens...@arnavion.dev>
+
+- Update to v1.22.3:
+  * foot.ini options:
+    * Disabled main.gamma-correct-blending option by default,
+      since correct blending with the option enabled is slower
+      (lower rendering throughput and higher input latency).
+    * Changed tweak.surface-bit-depth default from "8-bit" to "auto".
+      This becomes "8-bit" when main.gamma-correct-blending is "no"
+      and "10-bit" when that is "yes".
+  * See https://codeberg.org/dnkl/foot/releases/tag/1.22.3 for more details.
+
+-------------------------------------------------------------------

Old:
----
  foot-1.22.2.tar.gz
  foot-1.22.2.tar.gz.sig

New:
----
  foot-1.22.3.tar.gz
  foot-1.22.3.tar.gz.sig

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ foot.spec ++++++
--- /var/tmp/diff_new_pack.bbWM4d/_old  2025-05-08 20:40:02.916649678 +0200
+++ /var/tmp/diff_new_pack.bbWM4d/_new  2025-05-08 20:40:02.916649678 +0200
@@ -20,7 +20,7 @@
 %define _distconfdir %{_sysconfdir}
 %endif
 Name:           foot
-Version:        1.22.2
+Version:        1.22.3
 Release:        0
 Summary:        A Wayland terminal emulator
 License:        MIT

++++++ foot-1.22.2.tar.gz -> foot-1.22.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foot-1.22.2/CHANGELOG.md new/foot-1.22.3/CHANGELOG.md
--- old/foot-1.22.2/CHANGELOG.md        2025-04-30 10:23:51.000000000 +0200
+++ new/foot-1.22.3/CHANGELOG.md        2025-05-01 10:20:38.000000000 +0200
@@ -1,5 +1,6 @@
 # Changelog
 
+* [1.22.3](#1-22-3)
 * [1.22.2](#1-22-2)
 * [1.22.1](#1-22-1)
 * [1.22.0](#1-22-0)
@@ -61,6 +62,28 @@
 * [1.2.0](#1-2-0)
 
 
+## 1.22.3
+
+### Added
+
+* `auto` to the `tweak.surface-bit-depth` option.
+
+
+### Changed
+
+* `gamma-correct-blending` now defaults to `no` instead of `yes`.
+* `tweak.surface-bit-depth` default value changed to `auto`; uses
+  10-bit surfaces when `gamma-correct-blending=yes`, and 8-bit
+  surfaces otherwise.
+
+
+### Fixed
+
+* Inaccurate colors when `gamma-correct-blending=yes` ([#2082][2082]).
+
+[2082]: https://codeberg.org/dnkl/foot/issues/2082
+
+
 ## 1.22.2
 
 ### Changed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foot-1.22.2/config.c new/foot-1.22.3/config.c
--- old/foot-1.22.2/config.c    2025-04-30 10:23:51.000000000 +0200
+++ new/foot-1.22.3/config.c    2025-05-01 10:20:38.000000000 +0200
@@ -1083,17 +1083,8 @@
         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);
@@ -2780,7 +2771,7 @@
 
         return value_to_enum(
                 ctx,
-                (const char *[]){"8-bit", "10-bit", NULL},
+                (const char *[]){"auto", "8-bit", "10-bit", NULL},
                 (int *)&conf->tweak.surface_bit_depth);
     }
 
@@ -3318,7 +3309,7 @@
         .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,
         },
@@ -3428,7 +3419,7 @@
             .box_drawing_solid_shades = true,
             .font_monospace_warn = true,
             .sixel = true,
-            .surface_bit_depth = 8,
+            .surface_bit_depth = SHM_BITS_AUTO,
         },
 
         .touch = {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foot-1.22.2/config.h new/foot-1.22.3/config.h
--- old/foot-1.22.2/config.h    2025-04-30 10:23:51.000000000 +0200
+++ new/foot-1.22.3/config.h    2025-05-01 10:20:38.000000000 +0200
@@ -131,6 +131,12 @@
     struct config_spawn_template launch;
 };
 
+enum shm_bit_depth {
+    SHM_BITS_AUTO,
+    SHM_BITS_8,
+    SHM_BITS_10
+};
+
 struct config {
     char *term;
     char *shell;
@@ -168,9 +174,7 @@
     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;
 
@@ -410,7 +414,7 @@
         bool box_drawing_solid_shades;
         bool font_monospace_warn;
         bool sixel;
-        enum { SHM_8_BIT, SHM_10_BIT } surface_bit_depth;
+        enum shm_bit_depth surface_bit_depth;
     } tweak;
 
     struct {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foot-1.22.2/doc/foot.ini.5.scd 
new/foot-1.22.3/doc/foot.ini.5.scd
--- old/foot-1.22.2/doc/foot.ini.5.scd  2025-04-30 10:23:51.000000000 +0200
+++ new/foot-1.22.3/doc/foot.ini.5.scd  2025-05-01 10:20:38.000000000 +0200
@@ -220,14 +220,15 @@
        than intended when rendered with gamma-correct blending, since the
        font designer set the font weight based on incorrect rendering.
        
-       Note that some colors (especially dark ones) may be slightly
-       off. The reason for this is loss of color precision, due to foot
-       using 8-bit surfaces (i.e. each color channel is 8 bits). In all
-       known cases, the difference is small enough not to be noticed
-       though. The amount of errors can be reduced by using 10-bit
-       surfaces; see *tweak.surface-bit-depth*.
+       In order to represent colors faithfully, higher precision image
+       buffers are required. By default, foot will use 10-bit color
+       channels, if available, when gamma-correct blending is
+       enabled. However, the high precision buffers are slow; if you want
+       to use gamma-correct blending, but prefer speed (throughput and
+       input latency) over accurate colors, you can force 8-bit color
+       channels by setting *tweak.surface-bit-depth=8-bit*.
        
-       Default: enabled when compositor support is available
+       Default: _no_.
 
 *box-drawings-uses-font-glyphs*
        Boolean. When disabled, foot generates box/line drawing characters
@@ -1974,23 +1975,25 @@
 
 *surface-bit-depth*
        Selects which RGB bit depth to use for image buffers. One of
-       *8-bit*, or *10-bit*.
+       *auto*, *8-bit*, or *10-bit*.
+       
+       *auto* chooses bit depth depending on other settings, and
+       availability.
+       
+       *8-bit*, uses 8 bits for each color channel, alpha included. This
+       is the default when *gamma-correct-blending=no*.
        
-       The default, *8-bit*, uses 8 bits for all channels, alpha
-       included. When *gamma-correct-blending* is disabled, this is the
-       best option.
-       
-       When *gamma-correct-blending* is enabled, you may want to enable
-       10-bit surfaces, as that improves color precision. Be aware
-       however, that in this mode, the alpha channel is only 2 bits
-       instead of 8 bits. Thus, if you are using a transparent
-       background, you may want to use the default, *8-bit*, even if you
-       have gamma-correct blending enabled.
+       *10-bit* uses 10 bits for each RGB channel, and 2 bits for the
+       alpha channel. Thus, it provides higher precision color channels,
+       but a lower precision alpha channel. It is the default when
+       *gamma-correct-blending=yes*, if supported by the compositor.
        
-       You should also note that 10-bit surface is much slower. This will
-       increase input latency and decrease rendering throughput.
+       Note that *10-bit* is much slower than *8-bit*; if you want to use
+       gamma-correct blending, and if you prefer speed (throughput and
+       input latency) over accurate colors, you can set
+       *surface-bit-depth=8-bit* explicitly.
        
-       Default: _8-bit_
+       Default: _auto_
 
 # SEE ALSO
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foot-1.22.2/foot.ini new/foot-1.22.3/foot.ini
--- old/foot-1.22.2/foot.ini    2025-04-30 10:23:51.000000000 +0200
+++ new/foot-1.22.3/foot.ini    2025-05-01 10:20:38.000000000 +0200
@@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foot-1.22.2/meson.build new/foot-1.22.3/meson.build
--- old/foot-1.22.2/meson.build 2025-04-30 10:23:51.000000000 +0200
+++ new/foot-1.22.3/meson.build 2025-05-01 10:20:38.000000000 +0200
@@ -1,5 +1,5 @@
 project('foot', 'c',
-        version: '1.22.2',
+        version: '1.22.3',
         license: 'MIT',
         meson_version: '>=0.59.0',
         default_options: [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foot-1.22.2/pgo/pgo.c new/foot-1.22.3/pgo/pgo.c
--- old/foot-1.22.2/pgo/pgo.c   2025-04-30 10:23:51.000000000 +0200
+++ new/foot-1.22.3/pgo/pgo.c   2025-05-01 10:20:38.000000000 +0200
@@ -129,7 +129,7 @@
 }
 
 bool
-render_do_linear_blending(const struct terminal *term)
+wayl_do_linear_blending(const struct wayland *wayl, const struct config *conf)
 {
     return false;
 }
@@ -201,11 +201,12 @@
 
 void shm_unref(struct buffer *buf) {}
 void shm_chain_free(struct buffer_chain *chain) {}
+enum shm_bit_depth shm_chain_bit_depth(const struct buffer_chain *chain) { 
return SHM_BITS_8; }
 
 struct buffer_chain *
 shm_chain_new(
     struct wayland *wayl, bool scrollable, size_t pix_instances,
-    bool ten_bit_it_if_capable)
+    enum shm_bit_depth desired_bit_depth)
 {
     return NULL;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foot-1.22.2/render.c new/foot-1.22.3/render.c
--- old/foot-1.22.2/render.c    2025-04-30 10:23:51.000000000 +0200
+++ new/foot-1.22.3/render.c    2025-05-01 10:20:38.000000000 +0200
@@ -626,7 +626,7 @@
     pixman_color_t cursor_color;
     pixman_color_t text_color;
     cursor_colors_for_cell(term, cell, fg, bg, &cursor_color, &text_color,
-                           render_do_linear_blending(term));
+                           wayl_do_linear_blending(term->wl, term->conf));
 
     if (unlikely(!term->kbd_focus)) {
         switch (term->conf->cursor.unfocused_style) {
@@ -820,7 +820,7 @@
     if (cell->attrs.blink && term->blink.state == BLINK_OFF)
         _fg = color_blend_towards(_fg, 0x00000000, term->conf->dim.amount);
 
-    const bool gamma_correct = render_do_linear_blending(term);
+    const bool gamma_correct = wayl_do_linear_blending(term->wl, term->conf);
     pixman_color_t fg = color_hex_to_pixman(_fg, gamma_correct);
     pixman_color_t bg = color_hex_to_pixman_with_alpha(_bg, alpha, 
gamma_correct);
 
@@ -1180,7 +1180,8 @@
 render_urgency(struct terminal *term, struct buffer *buf)
 {
     uint32_t red = term->colors.table[1];
-    pixman_color_t bg = color_hex_to_pixman(red, 
render_do_linear_blending(term));
+    pixman_color_t bg = color_hex_to_pixman(
+        red, wayl_do_linear_blending(term->wl, term->conf));
 
     int width = min(min(term->margins.left, term->margins.right),
                     min(term->margins.top, term->margins.bottom));
@@ -1211,7 +1212,7 @@
     const int bmargin = term->height - term->margins.bottom;
     const int line_count = end_line - start_line;
 
-    const bool gamma_correct = render_do_linear_blending(term);
+    const bool gamma_correct = wayl_do_linear_blending(term->wl, term->conf);
     const uint32_t _bg = !term->reverse ? term->colors.bg : term->colors.fg;
     uint16_t alpha = term->colors.alpha;
 
@@ -1699,7 +1700,7 @@
     if (unlikely(term->is_searching))
         return;
 
-    const bool gamma_correct = render_do_linear_blending(term);
+    const bool gamma_correct = wayl_do_linear_blending(term->wl, term->conf);
 
     /* Adjust cursor position to viewport */
     struct coord cursor;
@@ -1970,7 +1971,8 @@
     case OVERLAY_FLASH:
         color = color_hex_to_pixman_with_alpha(
                 term->conf->colors.flash,
-                term->conf->colors.flash_alpha, 
render_do_linear_blending(term));
+                term->conf->colors.flash_alpha,
+                wayl_do_linear_blending(term->wl, term->conf));
         break;
 
     case OVERLAY_NONE:
@@ -2312,7 +2314,7 @@
     pixman_image_set_clip_region32(buf->pix[0], &clip);
     pixman_region32_fini(&clip);
 
-    const bool gamma_correct = render_do_linear_blending(term);
+    const bool gamma_correct = wayl_do_linear_blending(term->wl, term->conf);
     uint16_t alpha = _bg >> 24 | (_bg >> 24 << 8);
     pixman_color_t bg = color_hex_to_pixman_with_alpha(_bg, alpha, 
gamma_correct);
     pixman_image_fill_rectangles(
@@ -2453,7 +2455,7 @@
     if (info->width == 0 || info->height == 0)
         return;
 
-    const bool gamma_correct = render_do_linear_blending(term);
+    const bool gamma_correct = wayl_do_linear_blending(term->wl, term->conf);
 
     {
         /* Fully transparent - no need to do a color space transform */
@@ -2542,7 +2544,7 @@
     }
 
     return color_hex_to_pixman_with_alpha(
-        _color, alpha, render_do_linear_blending(term));
+        _color, alpha, wayl_do_linear_blending(term->wl, term->conf));
 }
 
 static void
@@ -2819,7 +2821,7 @@
     if (!term->visual_focus)
         _color = color_dim(term, _color);
 
-    const bool gamma_correct = render_do_linear_blending(term);
+    const bool gamma_correct = wayl_do_linear_blending(term->wl, term->conf);
     pixman_color_t color = color_hex_to_pixman_with_alpha(_color, alpha, 
gamma_correct);
     render_csd_part(term, surf->surf, buf, info->width, info->height, &color);
 
@@ -3678,7 +3680,7 @@
         : term->conf->colors.use_custom.search_box_no_match;
 
     /* Background - yellow on empty/match, red on mismatch (default) */
-    const bool gamma_correct = render_do_linear_blending(term);
+    const bool gamma_correct = wayl_do_linear_blending(term->wl, term->conf);
     const pixman_color_t color = color_hex_to_pixman(
         is_match
         ? (custom_colors
@@ -5247,10 +5249,3 @@
     seat->pointer.xcursor_pending = true;
     return true;
 }
-
-bool
-render_do_linear_blending(const struct terminal *term)
-{
-    return term->conf->gamma_correct != GAMMA_CORRECT_DISABLED &&
-           term->wl->color_management.img_description != NULL;
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foot-1.22.2/render.h new/foot-1.22.3/render.h
--- old/foot-1.22.2/render.h    2025-04-30 10:23:51.000000000 +0200
+++ new/foot-1.22.3/render.h    2025-05-01 10:20:38.000000000 +0200
@@ -47,5 +47,3 @@
 };
 
 struct csd_data get_csd_data(const struct terminal *term, enum csd_surface 
surf_idx);
-
-bool render_do_linear_blending(const struct terminal *term);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foot-1.22.2/shm.c new/foot-1.22.3/shm.c
--- old/foot-1.22.2/shm.c       2025-04-30 10:23:51.000000000 +0200
+++ new/foot-1.22.3/shm.c       2025-05-01 10:20:38.000000000 +0200
@@ -972,7 +972,7 @@
 
 struct buffer_chain *
 shm_chain_new(struct wayland *wayl, bool scrollable, size_t pix_instances,
-              bool ten_bit_if_capable)
+              enum shm_bit_depth desired_bit_depth)
 {
     pixman_format_code_t pixman_fmt_without_alpha = PIXMAN_x8r8g8b8;
     enum wl_shm_format shm_fmt_without_alpha = WL_SHM_FORMAT_XRGB8888;
@@ -982,8 +982,7 @@
 
     static bool have_logged = false;
 
-
-    if (ten_bit_if_capable) {
+    if (desired_bit_depth == SHM_BITS_10) {
         if (wayl->shm_have_argb2101010 && wayl->shm_have_xrgb2101010) {
             pixman_fmt_without_alpha = PIXMAN_x2r10g10b10;
             shm_fmt_without_alpha = WL_SHM_FORMAT_XRGB2101010;
@@ -1058,3 +1057,13 @@
 
     free(chain);
 }
+
+enum shm_bit_depth
+shm_chain_bit_depth(const struct buffer_chain *chain)
+{
+    const pixman_format_code_t fmt = chain->pixman_fmt_with_alpha;
+
+    return (fmt == PIXMAN_a2r10g10b10 || fmt == PIXMAN_a2b10g10r10)
+        ? SHM_BITS_10
+        : SHM_BITS_8;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foot-1.22.2/shm.h new/foot-1.22.3/shm.h
--- old/foot-1.22.2/shm.h       2025-04-30 10:23:51.000000000 +0200
+++ new/foot-1.22.3/shm.h       2025-05-01 10:20:38.000000000 +0200
@@ -9,6 +9,7 @@
 
 #include <tllist.h>
 
+#include "config.h"
 #include "wayland.h"
 
 struct damage;
@@ -46,9 +47,11 @@
 struct buffer_chain;
 struct buffer_chain *shm_chain_new(
     struct wayland *wayl, bool scrollable, size_t pix_instances,
-    bool ten_bit_it_if_capable);
+    enum shm_bit_depth desired_bit_depth);
 void shm_chain_free(struct buffer_chain *chain);
 
+enum shm_bit_depth shm_chain_bit_depth(const struct buffer_chain *chain);
+ 
 /*
  * Returns a single buffer.
  *
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foot-1.22.2/sixel.c new/foot-1.22.3/sixel.c
--- old/foot-1.22.2/sixel.c     2025-04-30 10:23:51.000000000 +0200
+++ new/foot-1.22.3/sixel.c     2025-05-01 10:20:38.000000000 +0200
@@ -110,10 +110,10 @@
     term->sixel.image.height = 0;
     term->sixel.image.alloc_height = 0;
     term->sixel.image.bottom_pixel = 0;
-    term->sixel.linear_blending = render_do_linear_blending(term);
+    term->sixel.linear_blending = wayl_do_linear_blending(term->wl, 
term->conf);
     term->sixel.pixman_fmt = PIXMAN_a8r8g8b8;
 
-    if (term->conf->tweak.surface_bit_depth == SHM_10_BIT) {
+    if (term->conf->tweak.surface_bit_depth == SHM_BITS_10) {
         if (term->wl->shm_have_argb2101010 && term->wl->shm_have_xrgb2101010) {
             term->sixel.use_10bit = true;
             term->sixel.pixman_fmt = PIXMAN_a2r10g10b10;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foot-1.22.2/terminal.c new/foot-1.22.3/terminal.c
--- old/foot-1.22.2/terminal.c  2025-04-30 10:23:51.000000000 +0200
+++ new/foot-1.22.3/terminal.c  2025-05-01 10:20:38.000000000 +0200
@@ -1073,19 +1073,16 @@
 
     options->scaling_filter = conf->tweak.fcft_filter;
     options->color_glyphs.format = PIXMAN_a8r8g8b8;
-    options->color_glyphs.srgb_decode = render_do_linear_blending(term);
+    options->color_glyphs.srgb_decode =
+        wayl_do_linear_blending(term->wl, term->conf);
 
-    if (conf->tweak.surface_bit_depth == SHM_10_BIT) {
-        if ((term->wl->shm_have_argb2101010 && term->wl->shm_have_xrgb2101010) 
||
-            (term->wl->shm_have_abgr2101010 && term->wl->shm_have_xbgr2101010))
-        {
-            /*
-             * Use a high-res buffer type for emojis. We don't want to
-             * use an a2r10g0b10 type of surface, since we need more
-             * than 2 bits for alpha.
-             */
-            options->color_glyphs.format = PIXMAN_rgba_float;
-        }
+    if (shm_chain_bit_depth(term->render.chains.grid) >= SHM_BITS_10) {
+        /*
+         * Use a high-res buffer type for emojis. We don't want to use
+         * an a2r10g0b10 type of surface, since we need more than 2
+         * bits for alpha.
+         */
+        options->color_glyphs.format = PIXMAN_rgba_float;
     }
 
     struct fcft_font *fonts[4];
@@ -1260,7 +1257,10 @@
         goto err;
     }
 
-    const bool ten_bit_surfaces = conf->tweak.surface_bit_depth == SHM_10_BIT;
+    const enum shm_bit_depth desired_bit_depth =
+        conf->tweak.surface_bit_depth == SHM_BITS_AUTO
+            ? wayl_do_linear_blending(wayl, conf) ? SHM_BITS_10 : SHM_BITS_8
+            : conf->tweak.surface_bit_depth;
 
     /* Initialize configure-based terminal attributes */
     *term = (struct terminal) {
@@ -1346,13 +1346,13 @@
         .render = {
             .chains = {
                 .grid = shm_chain_new(wayl, true, 1 + 
conf->render_worker_count,
-                                      ten_bit_surfaces),
-                .search = shm_chain_new(wayl, false, 1 ,ten_bit_surfaces),
-                .scrollback_indicator = shm_chain_new(wayl, false, 1, 
ten_bit_surfaces),
-                .render_timer = shm_chain_new(wayl, false, 1, 
ten_bit_surfaces),
-                .url = shm_chain_new(wayl, false, 1, ten_bit_surfaces),
-                .csd = shm_chain_new(wayl, false, 1, ten_bit_surfaces),
-                .overlay = shm_chain_new(wayl, false, 1, ten_bit_surfaces),
+                                      desired_bit_depth),
+                .search = shm_chain_new(wayl, false, 1 ,desired_bit_depth),
+                .scrollback_indicator = shm_chain_new(wayl, false, 1, 
desired_bit_depth),
+                .render_timer = shm_chain_new(wayl, false, 1, 
desired_bit_depth),
+                .url = shm_chain_new(wayl, false, 1, desired_bit_depth),
+                .csd = shm_chain_new(wayl, false, 1, desired_bit_depth),
+                .overlay = shm_chain_new(wayl, false, 1, desired_bit_depth),
             },
             .scrollback_lines = conf->scrollback.lines,
             .app_sync_updates.timer_fd = app_sync_updates_fd,
@@ -1495,7 +1495,7 @@
         xassert(term->window->is_configured);
         fdm_add(term->fdm, term->ptmx, EPOLLIN, &fdm_ptmx, term);
 
-        const bool gamma_correct = render_do_linear_blending(term);
+        const bool gamma_correct = wayl_do_linear_blending(term->wl, 
term->conf);
         LOG_INFO("gamma-correct blending: %s", gamma_correct ? "enabled" : 
"disabled");
     }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foot-1.22.2/tests/test-config.c 
new/foot-1.22.3/tests/test-config.c
--- old/foot-1.22.2/tests/test-config.c 2025-04-30 10:23:51.000000000 +0200
+++ new/foot-1.22.3/tests/test-config.c 2025-05-01 10:20:38.000000000 +0200
@@ -468,6 +468,7 @@
     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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foot-1.22.2/wayland.c new/foot-1.22.3/wayland.c
--- old/foot-1.22.2/wayland.c   2025-04-30 10:23:51.000000000 +0200
+++ new/foot-1.22.3/wayland.c   2025-05-01 10:20:38.000000000 +0200
@@ -1980,7 +1980,7 @@
         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 @@
             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 @@
                 LOG_WARN("  - TF: ext_linear");
                 LOG_WARN("  - primaries: sRGB");
             }
-        } else {
-            /* "auto" - don't warn */
         }
     }
 
@@ -2642,3 +2640,10 @@
 
     xdg_activation_v1_activate(wayl->xdg_activation, token, win->surface.surf);
 }
+
+bool
+wayl_do_linear_blending(const struct wayland *wayl, const struct config *conf)
+{
+    return conf->gamma_correct &&
+           wayl->color_management.img_description != NULL;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/foot-1.22.2/wayland.h new/foot-1.22.3/wayland.h
--- old/foot-1.22.2/wayland.h   2025-04-30 10:23:51.000000000 +0200
+++ new/foot-1.22.3/wayland.h   2025-05-01 10:20:38.000000000 +0200
@@ -26,6 +26,7 @@
 #include <fcft/fcft.h>
 #include <tllist.h>
 
+#include "config.h"
 #include "cursor-shape.h"
 #include "fdm.h"
 
@@ -539,3 +540,4 @@
     struct wl_window *win, activation_token_cb_t cb, void *cb_data);
 void wayl_activate(struct wayland *wayl, struct wl_window *win, const char 
*token);
 
+bool wayl_do_linear_blending(const struct wayland *wayl, const struct config 
*conf);

Reply via email to