<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/wayland.c, branch sixel-heap-buffer-overflow</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=sixel-heap-buffer-overflow</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=sixel-heap-buffer-overflow'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2026-04-06T13:25:08Z</updated>
<entry>
<title>wayland: shm: fix debug builds when LOG_ENABLE_DBG == 0</title>
<updated>2026-04-06T13:25:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-04-06T13:25:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ecf3b864e461bf6bf5033ac794cc6109013cd816'/>
<id>urn:sha1:ecf3b864e461bf6bf5033ac794cc6109013cd816</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: shm: included decoded fourcc name when logging shm formats</title>
<updated>2026-04-06T13:19:59Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-04-06T13:19:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=48aa5decef4db82092617e720b758a3a6f956bf7'/>
<id>urn:sha1:48aa5decef4db82092617e720b758a3a6f956bf7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: do all surface unmap and roundtrips before waiting for pre-apply damage</title>
<updated>2026-03-10T07:25:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-03-10T06:46:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=657db18a4ec4df93689c3eaae03b70f851724001'/>
<id>urn:sha1:657db18a4ec4df93689c3eaae03b70f851724001</id>
<content type='text'>
The pre-apply damage thread may be running when we destroy a terminal
instance, and we need to wait for it to finish before destroying the
underlying buffer.

c291194a4e593bbbb91420e81fa0111508084448 did this, but failed to
realize the thread may get re-started in the roundtrips done later in
wayl_win_destroy(); after the wait added in
c291194a4e593bbbb91420e81fa0111508084448, we unmap all
surfaces (including the main grid), and roundtrip. This means the
compositor will release the currently active buffer, and that means
_we_ will trigger the pre-apply damage thread on it. This introduces a
race, where wayl_win_destroy() may reach its shm_purge() calls before
the pre-apply damage thread has finished. That typically causes foot
to crash.

Closes #2288
</content>
</entry>
<entry>
<title>Add support for background blur</title>
<updated>2026-03-02T08:39:09Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-10-16T11:43:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=dea10e2e48162c6ab48ca564ceeca88dea886a04'/>
<id>urn:sha1:dea10e2e48162c6ab48ca564ceeca88dea886a04</id>
<content type='text'>
This patch adds a new config option: colors{,2}.blur=no|yes. When
enabled, transparent background are also blurred.

Note that this requires the brand new ext-background-effect-v1
protocol, and specifically, that the compositor implements the blur
effect.
</content>
</entry>
<entry>
<title>wayland: wait for pre-apply damage thread before destroying a terminal instance</title>
<updated>2026-02-02T11:40:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-01-28T08:44:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c291194a4e593bbbb91420e81fa0111508084448'/>
<id>urn:sha1:c291194a4e593bbbb91420e81fa0111508084448</id>
<content type='text'>
It's possible, but unlikely, that we've pushed a "pre-apply damage"
job to the renderer thread queue (or that we've pushed it, and the
a thread is now working on it) when we shutdown a terminal instance.

This is sometimes caught in an assertion in term_destroy(), where we
check the queue length is 0. Other times, or in release builds, we
might crash in the thread, or in the shutdown logic when freeing the
buffer chains associated with the terminal instance.

Fix by ensuring there's no pre-apply damage operation queued, or
running, before shutting down a terminal instance.

Closes #2263
</content>
</entry>
<entry>
<title>shm: don't bother with xrgb surfaces, always use argb</title>
<updated>2026-01-04T17:59:20Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-01-04T06:57:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b78cc92322dd2ae431dbbb70bc681b4d603d844d'/>
<id>urn:sha1:b78cc92322dd2ae431dbbb70bc681b4d603d844d</id>
<content type='text'>
Before this patch, foot used xrgb surfaces for all fully opaque
surfaces, and only used argb surfaces for the main window when the
user enabled translucency.

However, several compositors have damage-like issues when we switch
between opaque and non-opaque surfaces (for example, when switching
color theme, or when toggling fullscreen).

Since the performance benefit of using non-alpha aware surfaces are
likely minor (if there's any measurable performance difference at
all!), lets workaround these compositor issues by always using argb
surfaces.
</content>
</entry>
<entry>
<title>config: add toplevel-tag=TAG</title>
<updated>2025-11-12T10:04:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-11-12T10:04:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fc9625678fc7e295e7a7e03a5d47db21d4be3010'/>
<id>urn:sha1:fc9625678fc7e295e7a7e03a5d47db21d4be3010</id>
<content type='text'>
Add support for the new xdg-toplevel-tag-v1 Wayland protocol, by
exposing a new config option, `toplevel-tag`, and a corresponding
command option, `--toplevel-tag` (in both `foot` and `footclient`).

This can help the compositor with session management, or custom window
rules.

Closes #2212
</content>
</entry>
<entry>
<title>wayland: always render a new frame after a fullscreen change</title>
<updated>2025-10-15T07:41:52Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-10-15T07:41:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=dbf18ba444e728ecddcc0e15fc44cc1fc0590b53'/>
<id>urn:sha1:dbf18ba444e728ecddcc0e15fc44cc1fc0590b53</id>
<content type='text'>
This is needed, since we disable alpha in fullscreen, and since we use
different image buffer formats (XRGB vs. ARGB) when we have alpha
vs. when we don't (and fullscreen always disables alpha).

Normally, this happens anyway, as the window is resized when going in
or out from fullscreen. But, it's technically possible for a
compositor to change an application's fullscreen state without
resizing the window.
</content>
</entry>
<entry>
<title>wayland: restore opacity after exiting fullscreen</title>
<updated>2025-10-10T08:30:05Z</updated>
<author>
<name>Charalampos Mitrodimas</name>
<email>charmitro@posteo.net</email>
</author>
<published>2025-10-01T21:29:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fd88c6c61c52b75789c7f9d723815b67aed2984f'/>
<id>urn:sha1:fd88c6c61c52b75789c7f9d723815b67aed2984f</id>
<content type='text'>
When exiting fullscreen mode, the window's transparency was not being
restored, leaving it opaque until another window was fullscreened.

This occurred because the Wayland opaque region was set based only on
the configured alpha value, without considering the fullscreen state.

Since commit

  899b768b74 ("render: disable transparency when we're fullscreened")

transparency is disabled during fullscreen to avoid
compositor-mandated black backgrounds affecting the intended colors.
However, the opaque region was not being updated when the fullscreen
state changed.

Fixes: https://codeberg.org/dnkl/foot/issues/2180
Signed-off-by: Charalampos Mitrodimas &lt;charmitro@posteo.net&gt;
</content>
</entry>
<entry>
<title>wayland: fix global listener for xdg_toplevel_icon_manager_v1</title>
<updated>2025-05-24T10:06:29Z</updated>
<author>
<name>tokyo4j</name>
<email>hrak1529@gmail.com</email>
</author>
<published>2025-05-24T10:06:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=eeaecba7238fb3a501cb25b55b7d2ada2bc4d023'/>
<id>urn:sha1:eeaecba7238fb3a501cb25b55b7d2ada2bc4d023</id>
<content type='text'>
</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>wayland: configure: don't commit if we have a pending refresh</title>
<updated>2025-05-21T11:07:49Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-21T11:01:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d26659988113662d1500f600f5c10899920a5e6b'/>
<id>urn:sha1:d26659988113662d1500f600f5c10899920a5e6b</id>
<content type='text'>
Currently, if the following occurs:

1. foot has AxB size
2. Compositor sends CxD size
3. foot detects a resize, acks and saves CxD, but doesn't redraw immediately
4. Compositor sends CxD size again (due to a toplevel state array
   change, for example)

Then foot will detect no resize occurred, and will do an "empty"
commit immediately.

In this particular case that's wrong, since we're effectively
acking+committing the initial AxB size.

Fix by only doing the immediate commit if there's no size
change **and** there's no pending refresh.

Note: normally, we'd resize and refresh+commit immediately, but if
we're waiting for a frame callback, then the refresh+commit will be
delayed (i.e. scheduled). This is what we're checking here.

Closes #2105
</content>
</entry>
<entry>
<title>config: tweak.surface-bit-depth: add support for 16-bit surfaces</title>
<updated>2025-05-03T07:04:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-01T07:37:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=970e13db8deebf6c7542c7aede4f34703fa86769'/>
<id>urn:sha1:970e13db8deebf6c7542c7aede4f34703fa86769</id>
<content type='text'>
This adds supports for 16-bit surfaces, using the new
PIXMAN_a16b16g16r16 buffer format. This maps to
WL_SHM_FORMAT_ABGR16161616 (little-endian).

Use the new 16-bit surfaces by default, when
gamma-correct-blending=yes.
</content>
</entry>
<entry>
<title>wayland: attempt to log protocol errors on failure to flush</title>
<updated>2025-05-02T11:46:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-02T11:46:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5080e271c2fa5899ccb37384c26491e025b225ca'/>
<id>urn:sha1:5080e271c2fa5899ccb37384c26491e025b225ca</id>
<content type='text'>
When failing to flush, and the error is EPIPE, attempt to read and
dispatch events. This ensures protocol errors are logged.
</content>
</entry>
<entry>
<title>wayland: always call wl_display_dispatch_pending() at least once, after reading</title>
<updated>2025-05-02T11:43:59Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-02T11:43:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=237db6e771293689d6739de5aac7358d35dce5d3'/>
<id>urn:sha1:237db6e771293689d6739de5aac7358d35dce5d3</id>
<content type='text'>
This fixes an issue where protocol errors aren't reported. I'm
guessing the read succeeds, but that prepare_read() _also_ succeeds
immediately, since there aren't any events to dispatch (only log the
protocol error).

By calling dispatch unconditionally, we ensure any error messages are
printed. Then we proceed to loop prepare_read() + dispatch_pending()
until the queue is empty.
</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>wayland+input: add support for toplevel edge constraints</title>
<updated>2025-04-07T11:41:37Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-07T11:32:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=23431e3ecfb59f71627b332852b906dc3d0bfad7'/>
<id>urn:sha1:23431e3ecfb59f71627b332852b906dc3d0bfad7</id>
<content type='text'>
Edge constraints are new (not yet available in a wayland-protocols
release) toplevel states, acting as a complement to the existing tiled
states.

Tiled tells us we shouldn't draw shadows etc *outside our window
geometry*.

Constrained tells us the window cannot be resized in the constrained
direction.

This patch does a couple of things:

* Recognize the new states when debug logging

* Change is_top_left() etc to look at the new constrained state
  instead of the tiled state. These functions are used when both
  choosing cursor shape, and when determining if/how to resize a
  window on a CSD edge click-and-drag.

* Update cursor shape selection to use the default (left_ptr) shape
  when on a constrained edge (or corner).

* Update CSD resize triggering, to not trigger a resize when attempted
  on a constrained edge (or corner).

See
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/commit/86750c99ed062c306e837f11bb9492df572ad677:

    An edge constraint is an complementery state to the tiled state,
    meaning that it's not only tiled, but constrained in a way that it
    can't resize in that direction.

    This typically means that the constrained edge is tiled against a
    monitor edge. An example configuration is two windows tiled next
    to each other on a single monitor. Together they cover the whole
    work area.

    The left window would have the following tiled and edge constraint
    state:

        [ tiled_top, tiled_right, tiled_bottom, tiled_left,
          constrained_top, constrained_bottom, constrained_left ]

    while the right window would have the following:

        [ tiled_top, tiled_right, tiled_bottom, tiled_left,
          constrained_top, constrained_bottom, constrained_right ]

    This aims to replace and deprecate the
    `gtk_surface1.configure_edges` event and the
    `gtk_surface1.edge_constraint` enum.
</content>
</entry>
<entry>
<title>wayland: handle xdg-shell edge constraints</title>
<updated>2025-04-07T11:03:30Z</updated>
<author>
<name>Dominique Martinet</name>
<email>asmadeus@codewreck.org</email>
</author>
<published>2025-04-06T06:48:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=091aa90f1a726507803108b217f52224904115be'/>
<id>urn:sha1:091aa90f1a726507803108b217f52224904115be</id>
<content type='text'>
wayland-protocols commit 86750c99ed06 ("xdg-shell: Add edge
constraints") added a few more enums to handle, making the build fail
with -Werror:
../wayland.c: In function ‘xdg_toplevel_configure’:
../wayland.c:878:9: error: enumeration value ‘XDG_TOPLEVEL_STATE_CONSTRAINED_LEFT’ not handled in switch [-Werror=switch]
  878 |         switch (*state) {
      |         ^~~~~~
../wayland.c:878:9: error: enumeration value ‘XDG_TOPLEVEL_STATE_CONSTRAINED_RIGHT’ not handled in switch [-Werror=switch]
../wayland.c:878:9: error: enumeration value ‘XDG_TOPLEVEL_STATE_CONSTRAINED_TOP’ not handled in switch [-Werror=switch]
../wayland.c:878:9: error: enumeration value ‘XDG_TOPLEVEL_STATE_CONSTRAINED_BOTTOM’ not handled in switch [-Werror=switch]

(This is not part of any release yet, but can be used when building with
the submodule)

From a quick look it sounds like the meaning is the same as tiling as
far as we are concerned so handle these as we do of tiling.
</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>
</feed>
