<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/wayland.c, branch 1.8.2</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.8.2</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.8.2'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2021-07-18T14:46:43Z</updated>
<entry>
<title>render: use a single backing SHM pool for CSD surface buffers</title>
<updated>2021-07-18T14:46:43Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-18T14:46:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=20fc80e57e365f2e002eead7de110cb23ffa7adc'/>
<id>urn:sha1:20fc80e57e365f2e002eead7de110cb23ffa7adc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>shm: refactor: move away from a single, global, buffer list</title>
<updated>2021-07-17T17:14:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-16T14:48:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=53851e13ec976001cdec2077d7963c292bcd6d20'/>
<id>urn:sha1:53851e13ec976001cdec2077d7963c292bcd6d20</id>
<content type='text'>
Up until now, *all* buffers have been tracked in a single, global
buffer list. We've used 'cookies' to separate buffers from different
contexts (so that shm_get_buffer() doesn't try to re-use e.g. a
search-box buffer for the main grid).

This patch refactors this, and completely removes the global
list.

Instead of cookies, we now use 'chains'. A chain tracks both the
properties to apply to newly created buffers (scrollable, number of
pixman instances to instantiate etc), as well as the instantiated
buffers themselves.

This means there's strictly speaking not much use for shm_fini()
anymore, since its up to the chain owner to call shm_chain_free(),
which will also purge all buffers.

However, since purging a buffer may be deferred, if the buffer is
owned by the compositor at the time of the call to shm_purge() or
shm_chain_free(), we still keep a global 'deferred' list, on to which
deferred buffers are pushed. shm_fini() iterates this list and
destroys the buffers _even_ if they are still owned by the
compositor. This only happens at program termination, and not when
destroying a terminal instance. I.e. closing a window in a “foot
--server” does *not* trigger this.

Each terminal instatiates a number of chains, and these chains are
destroyed when the terminal instance is destroyed. Note that some
buffers may be put on the deferred list, as mentioned above.
</content>
</entry>
<entry>
<title>wayland: win_destroy: unmap URL labels</title>
<updated>2021-07-15T16:45:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-15T16:45:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5d7b729ac51ac80984da6d40f91a3a12bff0888a'/>
<id>urn:sha1:5d7b729ac51ac80984da6d40f91a3a12bff0888a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: explicitly purge all SHM pixmaps when destroying window</title>
<updated>2021-07-11T08:01:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-11T08:01:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a9872aac5af98ac5a643304b062aa984c4642f97'/>
<id>urn:sha1:a9872aac5af98ac5a643304b062aa984c4642f97</id>
<content type='text'>
All SHM pixmap cookies depend on the terminal instance’s memory
address. Thus, after a terminal instance has been destroyed, shm
pixmaps that belonged to it will never be purged automatically.
</content>
</entry>
<entry>
<title>wayland: purge CSD pixmaps when destroying the CSDs</title>
<updated>2021-07-11T07:59:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-11T07:59:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b5950d9b27f28d4b62f533b4df728e1170aacd62'/>
<id>urn:sha1:b5950d9b27f28d4b62f533b4df728e1170aacd62</id>
<content type='text'>
CSDs aren’t typically toggled on and off. Thus, when disabled,
immediately purge their corresponding pixmap buffers, to free up some
memory, and release file descriptors.
</content>
</entry>
<entry>
<title>url-mode: purge SHM pixmaps when destroying URLs</title>
<updated>2021-07-11T07:59:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-11T07:54:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0a6e7e6167e04e1ee38cfaba4d38c2776cf474b4'/>
<id>urn:sha1:0a6e7e6167e04e1ee38cfaba4d38c2776cf474b4</id>
<content type='text'>
Unlike other surface types, the SHM cookie depends on the address of
each URL instance. This means if we enable, disable, and then enable
URL mode again (thus showing exactly the same URLs as the first time),
the URLs will have new addresses, and thus the old SHM pixmaps will
not get purged automatically.

So, manually purge them when destroying the URLs.
</content>
</entry>
<entry>
<title>wayland: regression: properly instantiate CSDs when there’s no decoration manager</title>
<updated>2021-06-24T21:02:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-06-24T21:02:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=20c0650dfdfb64c17499e04665f491a6871d4917'/>
<id>urn:sha1:20c0650dfdfb64c17499e04665f491a6871d4917</id>
<content type='text'>
* Set win-&gt;configure.csd_mode, not win-&gt;csd_mode. Otherwise our
  ‘configure’ handler will swap out the CSD_YES we set, for
  CSD_UNKNOWN(?), resulting in no CSDs at all.

* Don’t instantiate the CSDs in wayl_win_init(), let the ‘configure’
  event handler do that. Just like it does when we have a decoration
  manager emitting decoration configure events.
</content>
</entry>
<entry>
<title>wayland: apply CSD/SSD changes in the surface configure event</title>
<updated>2021-06-23T10:37:56Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-06-22T16:58:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2a83202fddc4423fd102b0d5f19b0b445301a88e'/>
<id>urn:sha1:2a83202fddc4423fd102b0d5f19b0b445301a88e</id>
<content type='text'>
    The configure event asks the client to change its decoration
    mode. The configured state should not be applied immediately.
    Clients must send an ack_configure in response to this event.
    See xdg_surface.configure and xdg_surface.ack_configure for
    details.

In particular, ”the configured state should *not* be applied
immediately”.

Instead, treat CSD/SSD changes like all other window dimension related
changes: store the to-be mode in win-&gt;configure, and apply it in the
surface configure event.

This fixes an issue where foot incorrectly resized the window when the
server switched between CSD/SSD at run-time.
</content>
</entry>
<entry>
<title>wayland: fdm callback: check return value of wl_display_dispatch_pending()</title>
<updated>2021-05-25T15:50:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-24T18:51:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c3c2ff739853432a15f75f53744c4998a0c27455'/>
<id>urn:sha1:c3c2ff739853432a15f75f53744c4998a0c27455</id>
<content type='text'>
Since it’s inside a while-loop, we’d better handle failures, or we
risk getting stuck.
</content>
</entry>
<entry>
<title>wayland: roundtrip: log error and abort when wl_display_roundtrip() fails</title>
<updated>2021-05-25T15:50:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-24T18:42:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7bdecaae3bc3f493ab7cbec637f7c373b6d96357'/>
<id>urn:sha1:7bdecaae3bc3f493ab7cbec637f7c373b6d96357</id>
<content type='text'>
ayl_roundtrip() has the following code:

    wl_display_roundtrip(wayl-&gt;display);

    while (wl_display_prepare_read(wayl-&gt;display) != 0)
        wl_display_dispatch_pending(wayl-&gt;display);
    wayl_flush(wayl);

If the first wl_display_roundtrip() fails, for example because the
Wayland socket has been closed, we may get stuck in the while-loop.

This happens if the read queue isn’t empty, in which case
wl_display_prepare_read() will return -1 and we’ll continue trying to
dispatch the pending events forever, never succeeding since the socket
is gone.

Closes #542
</content>
</entry>
<entry>
<title>term: get rid of term-&gt;font_scale, use term-&gt;scale only</title>
<updated>2021-05-17T15:55:49Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-13T09:10:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2afc6782361d0deaa443234466775b1121feec8f'/>
<id>urn:sha1:2afc6782361d0deaa443234466775b1121feec8f</id>
<content type='text'>
We only needed term-&gt;font_scale to be able to detect scaling factor
changes (term-&gt;font_scale != term-&gt;scale).

But, we already have the old scaling factor in all places where
term_font_dpi_changed() is called, so let’s pass the old scaling
factor as an argument instead.
</content>
</entry>
<entry>
<title>wayland: workaround epoll-shim defining the macro close</title>
<updated>2021-05-14T11:26:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-11T20:02:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=584d2cacf18e885c8b88e5e8472f62ded00881e5'/>
<id>urn:sha1:584d2cacf18e885c8b88e5e8472f62ded00881e5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>meson: add xdg-activation-v1.xml conditionally</title>
<updated>2021-05-14T11:26:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-11T15:58:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=03e1b906abc6b29bb4b76b6e0429b8da9e2e2c0e'/>
<id>urn:sha1:03e1b906abc6b29bb4b76b6e0429b8da9e2e2c0e</id>
<content type='text'>
Only enable XDG activation when compiling against wayland-protocols
1.21. Older versions don’t have this protocol.

When available, define HAVE_XDG_ACTIVATION.

Make all usages of xdg_activation_v1 and xdg_activation_token_v1
conditional.
</content>
</entry>
<entry>
<title>wayland: set xdg activation token surface to our top-level</title>
<updated>2021-05-14T11:26:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-10T16:01:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f5f1bc8dd95b319aa7574db139c40c0697025d0b'/>
<id>urn:sha1:f5f1bc8dd95b319aa7574db139c40c0697025d0b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>xdg-activation: initial support for setting urgency using XDG activation</title>
<updated>2021-05-14T11:26:04Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-09T10:13:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3e92361534cdd02e8da8a5f7e8112361b1d6eb67'/>
<id>urn:sha1:3e92361534cdd02e8da8a5f7e8112361b1d6eb67</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: codespell: pre-empt -&gt; preempt</title>
<updated>2021-05-11T06:02:46Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-11T06:02:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1501d36470e7ee401f832ee14d18a19589027559'/>
<id>urn:sha1:1501d36470e7ee401f832ee14d18a19589027559</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: add comment describing the configure preempt workaround</title>
<updated>2021-05-10T15:57:14Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-10T15:57:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2e8bea0a5d69a82f38b0b9e88ca292c84ddf2852'/>
<id>urn:sha1:2e8bea0a5d69a82f38b0b9e88ca292c84ddf2852</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: {xdg_,}output_*(): free old strings before assigning new ones</title>
<updated>2021-04-07T06:04:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-04-07T06:04:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=44a166dde80d7bf4fa843b1da760bfc8de25c0e5'/>
<id>urn:sha1:44a166dde80d7bf4fa843b1da760bfc8de25c0e5</id>
<content type='text'>
Defensive programming; output_geometry() etc are typically only called
once for an output instance. But let’s ensure we’re not leaking memory
if it’s called more than once.
</content>
</entry>
<entry>
<title>ime: move preedit state from terminal struct to the seat struct</title>
<updated>2021-03-25T08:36:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-03-23T12:03:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e8ffb05bc7fb3b996752f345b77af4b757f69776'/>
<id>urn:sha1:e8ffb05bc7fb3b996752f345b77af4b757f69776</id>
<content type='text'>
This ensures different seat’s don’t step on each others IME pre-edit
state.

It also removes most dependencies on having a valid term pointer for
many IME operations.

We’re still not all the way, since we support disabling IME with a
private mode, which is per terminal, not seat.

Thus, we still require the seat to have keyboard focus on one of our
windows.

Closes #324. But note that *rendering* of multiple seat’s IME pre-edit
strings is still broken.
</content>
</entry>
<entry>
<title>wayland: rename variable ‘main’ to ‘main_surface’</title>
<updated>2021-02-25T06:46:21Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-25T06:46:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3149ef16c318c0e787392be3a042d864fd604ffa'/>
<id>urn:sha1:3149ef16c318c0e787392be3a042d864fd604ffa</id>
<content type='text'>
Some compilers don’t think we know what we’re doing:

  ../wayland.c:1554:24: error: ‘main’ is usually a function
</content>
</entry>
</feed>
