<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/render.c, branch 1.23.1</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.23.1</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.23.1'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2025-06-09T05:08:24Z</updated>
<entry>
<title>quirks: remove subsurface unmap quirk for Sway</title>
<updated>2025-06-09T05:08:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-06-09T05:08:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7347f4beb1314df12e834a260f18feae8b775a5a'/>
<id>urn:sha1:7347f4beb1314df12e834a260f18feae8b775a5a</id>
<content type='text'>
Sway used to have an issue where unmapping a subsurface did not damage
the surface below (https://github.com/swaywm/sway/issues/6960).

This has been fixed for quite some time now, so let's remove the
quirk.
</content>
</entry>
<entry>
<title>conf: pad: add center-when-fullscreen and center-when-maximized-and-fullscreen</title>
<updated>2025-05-24T07:56:16Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-23T06:38:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5a84f8d841d09e9aa91befbbb8e8b634b7f8959a'/>
<id>urn:sha1:5a84f8d841d09e9aa91befbbb8e8b634b7f8959a</id>
<content type='text'>
Before this patch, the grid content was *always* centered when the
window was maximized or fullscreened, regardless of how the user had
configured padding.

Now, the behavior is controlled by the 'pad' option. Before this
patch, the syntax was

    pad MxN [center]

Now it is

    pad MxN [center|center-when-fullscreen|center-when-maximized-and-fullscreen]

The default is "pad 0x0 center-when-maximized-and-fullscreen", to
match current behavior.

Closes #2111
</content>
</entry>
<entry>
<title>cursor-shape: add 'dnd-ask' and 'all-resize'</title>
<updated>2025-05-22T04:59:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-21T13:25:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=664cdcc65cf42ab269ea4a2c4962c3ee65d7e92f'/>
<id>urn:sha1:664cdcc65cf42ab269ea4a2c4962c3ee65d7e92f</id>
<content type='text'>
These (non-css) cursor shapes were added to the cursor-shape-v1
protocol in wayland-protocols 1.42.

We don't need (or use them at all) internally, but add them to the
list we use to translate from shape names to shape enums. This allows
users to set a custom shape (via OSC-22), while still using server
side cursors (i.e. no need to fallback to client-side cursors).

If we try to set a shape not implemented by the server, we get a
protocol error and foot exits. This is bad.

So, make sure we don't do that:

1. First, we need to explicitly bind v2 if implemented by the server
2. Track the bound version number in the wayland struct
3. When matching shape enum, skip shapes not supported in the
   currently bound version of the cursor-shape protocol
</content>
</entry>
<entry>
<title>render: improve CSD button positioning</title>
<updated>2025-05-21T05:39:35Z</updated>
<author>
<name>Kirill Primak</name>
<email>vyivel@eclair.cafe</email>
</author>
<published>2025-05-20T12:01:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=456ac5d79f46a670479fcdaa75df0942a1571c78'/>
<id>urn:sha1:456ac5d79f46a670479fcdaa75df0942a1571c78</id>
<content type='text'>
This commit fixes titlebar button positioning when maximization isn't
available but minimization is.
</content>
</entry>
<entry>
<title>render: refactor to allow setting only selection bg or fg</title>
<updated>2025-05-05T11:02:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-05T10:43:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=073b637d4535cd0dfe92ca1ce954b552ae9f1a4a'/>
<id>urn:sha1:073b637d4535cd0dfe92ca1ce954b552ae9f1a4a</id>
<content type='text'>
Before this, we only applied custom selection colors, if *both* the
selection bg and fg had been set.

Since the options are already split up into two separate options, and
since it makes sense to at least be able to keep the foreground colors
unchanged (i.e. only setting the selection background), let's allow
only having one of the selection colors set.

Closes #1846
</content>
</entry>
<entry>
<title>config: tweak.surface-bit-depth now defaults to 'auto'</title>
<updated>2025-05-01T06:54:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-01T06:34:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e5a0755451b736c635be58764799ef8d7b536e8d'/>
<id>urn:sha1:e5a0755451b736c635be58764799ef8d7b536e8d</id>
<content type='text'>
When set to 'auto', use 10-bit surfaces if gamma-correct blending is
enabled, and 8-bit surfaces otherwise.

Note that we may still fallback to 8-bit surfaces (without disabling
gamma-correct blending) if the compositor does not support 10-bit
surfaces.

Closes #2082
</content>
</entry>
<entry>
<title>config: gamma-correct-blending: disable by default</title>
<updated>2025-05-01T06:09:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-01T06:09:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b07ce56321404a34fc02635ecf4d5b63ddddf1ea'/>
<id>urn:sha1:b07ce56321404a34fc02635ecf4d5b63ddddf1ea</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: regression: alpha applied to inversed text/selections</title>
<updated>2025-04-25T17:20:36Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-25T17:20:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=cb1b7ba0c5752eeb92c72a80640fbd1f09ad4b7d'/>
<id>urn:sha1:cb1b7ba0c5752eeb92c72a80640fbd1f09ad4b7d</id>
<content type='text'>
Introduced by 5f83278afd0530c323d4192e1095b3d1dea644c9

Closes #2073
</content>
</entry>
<entry>
<title>render: fix colors.alpha-mode=matching</title>
<updated>2025-04-19T11:33:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-19T05:46:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1a2e5f4932a17c9804ca6d201b7d8cf84d7f19d9'/>
<id>urn:sha1:1a2e5f4932a17c9804ca6d201b7d8cf84d7f19d9</id>
<content type='text'>
Before this patch, it only matched RGB color sources. It did not match
the default bg color, or indexed colors. That is, e.g. CSI 43m didn't
apply alpha, even if the color3 matched the default background color.
</content>
</entry>
<entry>
<title>config+render: move alpha-mode to colors.alpha-mode, fix cursor handling</title>
<updated>2025-04-14T14:58:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-14T14:58:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d2d4f538619177bc3af6c09e2465272f564ee780'/>
<id>urn:sha1:d2d4f538619177bc3af6c09e2465272f564ee780</id>
<content type='text'>
Move main.alpha-mode to colors.alpha-mode.

Fix (inverted) cursor handling, by always using the bg color without
alpha.

Do a minor optimization, where we don't even lock at colors.alpha-mode
if there's no transparency configured.
</content>
</entry>
<entry>
<title>config: add alpha_mode option</title>
<updated>2025-04-14T14:47:45Z</updated>
<author>
<name>Fazzi</name>
<email>faaris.ansari@proton.me</email>
</author>
<published>2023-10-09T17:47:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5f83278afd0530c323d4192e1095b3d1dea644c9'/>
<id>urn:sha1:5f83278afd0530c323d4192e1095b3d1dea644c9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: dim and brighten using linear rgb interpolation</title>
<updated>2025-03-23T14:24:23Z</updated>
<author>
<name>Sam McCall</name>
<email>sam.mccall@gmail.com</email>
</author>
<published>2025-03-22T19:11:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=663c9082db4dfe43bb329a09fd5b93a6ba99fdb6'/>
<id>urn:sha1:663c9082db4dfe43bb329a09fd5b93a6ba99fdb6</id>
<content type='text'>
Adds setting tweak.dim-amount, similar to bold-text-in-bright-amount.

Closes #2006
</content>
</entry>
<entry>
<title>meson: require wayland-protocols &gt;= 1.41</title>
<updated>2025-03-13T12:28:34Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-03-12T16:53:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d48a1c53f59e8b7c99c18f4e4a5693ca0b10bd52'/>
<id>urn:sha1:d48a1c53f59e8b7c99c18f4e4a5693ca0b10bd52</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: gamma-correct blending</title>
<updated>2025-03-05T17:45:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-21T10:01:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ccf625b9914917e131beb83379c526bab1927edc'/>
<id>urn:sha1:ccf625b9914917e131beb83379c526bab1927edc</id>
<content type='text'>
This implements gamma-correct blending, which mainly affects font
rendering.

The implementation requires compile-time availability of the new
color-management protocol (available in wayland-protocols &gt;= 1.41),
and run-time support for the same in the compositor (specifically, the
EXT_LINEAR TF function and sRGB primaries).

How it works: all colors are decoded from sRGB to linear (using a
lookup table, generated in the exact same way pixman generates it's
internal conversion tables) before being used by pixman. The resulting
image buffer is thus in decoded/linear format. We use the
color-management protocol to inform the compositor of this, by tagging
the wayland surfaces with the 'ext_linear' image attribute.

Sixes: all colors are sRGB internally, and decoded to linear before
being used in any sixels. Thus, the image buffers will contain linear
colors. This is important, since otherwise there would be a
decode/encode penalty every time a sixel is blended to the grid.

Emojis: we require fcft &gt;= 3.2, which adds support for sRGB decoding
color glyphs. Meaning, the emoji pixman surfaces can be blended
directly to the grid, just like sixels.

Gamma-correct blending is enabled by default *when the compositor
supports it*. There's a new option to explicitly enable/disable it:
gamma-correct-blending=no|yes. If set to 'yes', and the compositor
does not implement the required color-management features, warning
logs are emitted.

There's a loss of precision when storing linear pixels in 8-bit
channels. For this reason, this patch also adds supports for 10-bit
surfaces. For now, this is disabled by default since such surfaces
only have 2 bits for alpha. It can be enabled with
tweak.surface-bit-depth=10-bit.

Perhaps, in the future, we can enable it by default if:

* gamma-correct blending is enabled
* the user has not enabled a transparent background
</content>
</entry>
<entry>
<title>config+render: allow cursor.style=hollow</title>
<updated>2025-02-19T10:50:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-19T10:44:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c41008da31aba42e3d0e25966af9eab27cfd3fac'/>
<id>urn:sha1:c41008da31aba42e3d0e25966af9eab27cfd3fac</id>
<content type='text'>
Closes #1965
</content>
</entry>
<entry>
<title>render: minimum window size: 2 cols -&gt; 1 col</title>
<updated>2025-02-10T12:19:57Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-10T11:42:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8b63869f5707a771e60ae745d1069860c9056cc5'/>
<id>urn:sha1:8b63869f5707a771e60ae745d1069860c9056cc5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>grid: refactor reflow</title>
<updated>2025-02-10T12:19:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-10T07:57:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3d66db63ccb1baab2d78e6d104a9c15d3f6684d1'/>
<id>urn:sha1:3d66db63ccb1baab2d78e6d104a9c15d3f6684d1</id>
<content type='text'>
We've been trying to performance optimize reflow by "chunking" cells;
try to gather as many as possible, and memcpy a chunk at once.

The problem is that a) this quickly becomes very complex, and b) is
very hard to get right for multi-column characters, especially when we
need to truncate long ones due to the window being too small.

Refactor, and once again walk and copy all cells one by one. This is
slower, but at least it's correct.
</content>
</entry>
<entry>
<title>render: resize: note why min_cols=7</title>
<updated>2025-02-06T13:02:38Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-05T10:38:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a3a404a2570b72636da0583492d9cf87b700ef6b'/>
<id>urn:sha1:a3a404a2570b72636da0583492d9cf87b700ef6b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>osc: wip: kitty text size protocol</title>
<updated>2025-02-06T06:42:38Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-25T13:09:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7a8d2b5e012636def9545075e01cdf9a6f309355'/>
<id>urn:sha1:7a8d2b5e012636def9545075e01cdf9a6f309355</id>
<content type='text'>
This brings initial support for the new kitty text-sizing
protocol. Note hat only the width-parameter ('w') is supported. That
is, no font scaling, and no multi-line cells.

For now, only explicit widths are supported. That is, w=0 does not yet
work.

There are a couple of changes to the renderer, to handle e.g.

    OSC 66 ; w=6 ; foobar ST

There are two ways this can get rendered, depending on whether
grapheme shaping has been enabled. We either shape it, and get an
array of glyphs back that we render. Or, we rasterize each codepoint
ourselves, and render each resulting glyph.

The two cases ends up in two different renderer loops, that worked
somewhat different. In particular, the first case has probably never
been tested/used at all...

With this patch, both are changed, and now uses some heuristic to
differentiate between multi-cell text strings (like in the example
above), or single-cell combining characters. The difference is mainly
in which offset to use for the secondary glyphs.

In a multi-cell string, each glyph is mapped to its own cell, while in
the combining case, we try to map all glyphs to the same cell.
</content>
</entry>
<entry>
<title>render: resize: configure with only one dimension being zero</title>
<updated>2025-01-26T08:28:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-26T08:28:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=846271e8d3056ef3ecd3d2f4b7df6151e17c3c70'/>
<id>urn:sha1:846271e8d3056ef3ecd3d2f4b7df6151e17c3c70</id>
<content type='text'>
The protocol states:

    If the width or height arguments are zero, it means the client
    should decide its own window dimension. This may happen when the
    compositor needs to configure the state of the surface but doesn't
    have any information about any previous or expected dimension.

The wording is a bit ambiguous; does it mean we should set *both*
width and height to values we choose, even if only one dimension is
zero in the configure event? Or does it mean that we should choose the
value for the dimension that is zero in the configure event?

Regardless, it's pretty clear that it does *not* mean we should *only*
choose width and height if *both* dimensions are zero in the configure
event. This is foot's behavior before this patch, meaning if only one
of them is zero, foot assumed the compositor wanted us to set the
width (or height) to zero...

Change this, so that we now choose value for the "missing" dimension,
but do use the compositor provided value for the other dimension.

Closes #1925

Relevant issues:

* https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/155
* https://github.com/YaLTeR/niri/issues/1050
</content>
</entry>
</feed>
