<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/wayland.c, branch master</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=master</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2026-10-25T11:08:15Z</updated>
<entry>
<title>wayland: update_terms_on_monitor(): skip terminals in the process of shutting down</title>
<updated>2026-10-25T11:08:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-10-25T11:08:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=152487e494993ad7fb5633a27c7d7ad0f8810ea5'/>
<id>urn:sha1:152487e494993ad7fb5633a27c7d7ad0f8810ea5</id>
<content type='text'>
In rare cases, xdg_output_handle_done() may be called while a terminal
is shutting down. This triggered a crash in
update_terms_for_monitor(), which de-references term-&gt;window (which is
NULL for terminals shutting down).

Closes #2487
</content>
</entry>
<entry>
<title>wayland: clear touch focus in wayl_win_destroy()</title>
<updated>2026-08-29T07:55:45Z</updated>
<author>
<name>Marinus Klasen</name>
<email>marinus@mklasen.nl</email>
</author>
<published>2026-08-19T21:05:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f8a367896a57d84967d7b537ee618aae8081e2ea'/>
<id>urn:sha1:f8a367896a57d84967d7b537ee618aae8081e2ea</id>
<content type='text'>
wl_touch has no leave event, so unmapping the surfaces cannot drop touch
focus the way it drops keyboard and pointer focus. seat-&gt;touch.surface
kept pointing at the window being destroyed, and seat-&gt;touch.state stayed
HELD/DRAGGING, so the guard in wl_touch_up() and wl_touch_motion() did not
fire. A wl_touch.up dispatched from the roundtrips in wayl_win_destroy()
then dereferenced the freed window:

    #0  wl_touch_up () at input.c:3587
    #12 wayl_roundtrip () at wayland.c:2416
    #13 wayl_win_destroy () at wayland.c:2297

Reproduced by touching a foot window and holding while the window is
destroyed: 3/3 crashes before, 0/7 after.
</content>
</entry>
<entry>
<title>wayland: handle_global_remove(): call wl_fixes::ack_global_remove(), when available</title>
<updated>2026-08-19T04:44:38Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-07-30T09:09:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=85655c74a4ded119392ea8b632626c3920042807'/>
<id>urn:sha1:85655c74a4ded119392ea8b632626c3920042807</id>
<content type='text'>
wayland 1.26 adds wl_fixes::ack_global_remove(). Clients should call
it when they've received a global_remove() event, after doing internal
cleanup.

Not tested yet:

* Waiting for arch to update wayland to 1.26
* None of the compositors I use (or test on) implement it yet.
</content>
</entry>
<entry>
<title>terminal: add visibility reports</title>
<updated>2026-07-30T12:18:58Z</updated>
<author>
<name>Tim Culverhouse</name>
<email>tim@timculverhouse.com</email>
</author>
<published>2026-07-28T19:16:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8db88cceb758b5be23e7db1fe74a48102ab07dc0'/>
<id>urn:sha1:8db88cceb758b5be23e7db1fe74a48102ab07dc0</id>
<content type='text'>
Applications cannot infer whether their terminal view is observable from
keyboard focus alone, so they may continue expensive rendering while the
surface is hidden.

Implement private mode 2033 and the one-shot visibility query. Report
Wayland xdg_toplevel suspension as not visible and otherwise remain
conservative by treating the terminal as potentially visible.

Amp-Thread-ID: https://ampcode.com/threads/T-019fb2b7-f245-7124-a69a-1484812532bb
Co-authored-by: Amp &lt;amp@ampcode.com&gt;
</content>
</entry>
<entry>
<title>wayland: fix version selection of the shape-manager global</title>
<updated>2026-07-30T09:07:29Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-07-30T09:07:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=28a59ab73f60276102f5d3b63e4894ebb92a82ab'/>
<id>urn:sha1:28a59ab73f60276102f5d3b63e4894ebb92a82ab</id>
<content type='text'>
Use the smallest of the *implemented* version, and the *preferred*
version.

Before this, we used the minimum of our *required* version, and
the *preferred* version, which is both useless and wrong, since we'll
always pick the required version (since required &lt;= preferred).
</content>
</entry>
<entry>
<title>wayland: win_destroy(): unmap overlay surface before destroy</title>
<updated>2026-06-18T05:48:05Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2026-06-18T05:48:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=43d2d97386663ebd42563eb44b7fca8e9a7584ae'/>
<id>urn:sha1:43d2d97386663ebd42563eb44b7fca8e9a7584ae</id>
<content type='text'>
Like we do with all other surfaces.
</content>
</entry>
<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>
</feed>
