<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/wayland.c, branch 1.11.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.11.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.11.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2022-02-03T17:01:13Z</updated>
<entry>
<title>wayland: remove workaround for sway-1.5 bug - slow resizing of hidden windows</title>
<updated>2022-02-03T17:01:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-11T20:09:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=af4ae653493ecfbc570f1a16adc65a8c728dad0c'/>
<id>urn:sha1:af4ae653493ecfbc570f1a16adc65a8c728dad0c</id>
<content type='text'>
In Sway-1.5, sway waits for configure ACKs from hidden windows when
views are being resized. I.e. if you have e.g. a stacked view, with
one or more windows currently not visible, and you resize the stack,
then sway will emit configure events to all windows, and then wait for
ACKs before rendering the resized view.

The problem with this is that sway also does **not** call frame
callbacks on hidden windows. So if we have rendered one frame, and
thus registered a frame callback, we’ll never render any more frames
until the window becomes visible again. Ergo, if you resize the view
interactively, only the first resize actually happens. After that, all
hidden views are “stuck”, causing ACK timeouts.

We worked around this in foot by preempting the frame
callback. I.e. destroying it, and rendering the frame anyway.

This has fixed in sway-1.6, and thus we can remove the workaround.
</content>
</entry>
<entry>
<title>wayland: use strtol() to parse xcursor_size</title>
<updated>2022-01-29T12:22:06Z</updated>
<author>
<name>Pranjal Kole</name>
<email>pranjal.kole7@gmail.com</email>
</author>
<published>2022-01-29T12:01:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d9cd1749e0027dcb0f8e6bb755f69b99a1318e85'/>
<id>urn:sha1:d9cd1749e0027dcb0f8e6bb755f69b99a1318e85</id>
<content type='text'>
sscanf is not very robust. For example,
$ XCURSOR_SIZE="36asdf" foot
works without any errors, and xcursor_size is parsed as 36.
</content>
</entry>
<entry>
<title>wayland: use getenv() according to spec</title>
<updated>2022-01-29T10:48:19Z</updated>
<author>
<name>Pranjal Kole</name>
<email>pranjal.kole7@gmail.com</email>
</author>
<published>2022-01-29T10:48:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fa396cdc33c81cae52942154d69db39ee7079748'/>
<id>urn:sha1:fa396cdc33c81cae52942154d69db39ee7079748</id>
<content type='text'>
From the NOTES section of getenv(3):
 The string pointed to by the return value of getenv() may be statically
 allocated, and can be modified by a subsequent call to getenv()...

So, previously xcursor_theme could be modified by libc to contain
xcursor_size. This has been fixed by getting xcursor_theme after
computing the value of xcursor_size.
</content>
</entry>
<entry>
<title>config: convert tweak.render_timer to an enum</title>
<updated>2022-01-13T11:08:20Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-13T11:08:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=891fce62364704b7fc05bfe723a3619297b5b9e0'/>
<id>urn:sha1:891fce62364704b7fc05bfe723a3619297b5b9e0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: don’t try to bind wl_output version 4 unconditionally</title>
<updated>2022-01-06T19:00:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-06T19:00:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ccf9c0fe29a8031804aa0d07a97da58c0e2cac04'/>
<id>urn:sha1:ccf9c0fe29a8031804aa0d07a97da58c0e2cac04</id>
<content type='text'>
The compositor may offer version 4, while we’re still linked against
an old libwayland that does not implement version 4.

While we properly #ifdef the callbacks from version 4, we were still
requesting version 4 (if offered by the compositor), even when
compiled against a too old libwayland.

Closes #876
</content>
</entry>
<entry>
<title>wayland: add wl_output.name() and wl_output.description()</title>
<updated>2021-12-13T18:17:48Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-13T18:17:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=01a417660d4a1d8d52c3fb0c8a79556623a7cc24'/>
<id>urn:sha1:01a417660d4a1d8d52c3fb0c8a79556623a7cc24</id>
<content type='text'>
These are new in version 4 of the wl_output interface (first included
in wayland-1.20).

This allows us to get the name and description of the outputs, also on
compositors without the XDG output interface.
</content>
</entry>
<entry>
<title>wayland: estimate scaled (logical) width/height, if not provided</title>
<updated>2021-12-13T18:15:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-13T18:15:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=97174913e09db464d3020c50cbf223d2fe823d3d'/>
<id>urn:sha1:97174913e09db464d3020c50cbf223d2fe823d3d</id>
<content type='text'>
This makes us slightly more resilient against a missing XDG output
interface.

We use the “real” (the physical) dimensions, combined with the scaling
factor, to estimate the logical dimensions.

This works out correctly with  non-fractional scaling, but not
otherwise.
</content>
</entry>
<entry>
<title>wayland: guard XDG startup notification with HAVE_XDG_ACTIVATION</title>
<updated>2021-11-09T17:23:44Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-09T17:23:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3e04c4e4f48195134aaf5671b528435fd8801e3c'/>
<id>urn:sha1:3e04c4e4f48195134aaf5671b528435fd8801e3c</id>
<content type='text'>
Fixes compilation on systems with “too old” wayland-protocols
</content>
</entry>
<entry>
<title>wayland: error out if there aren’t any seats available</title>
<updated>2021-11-07T10:29:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-11-07T10:29:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0183e13f505c0afa7cea9eb5a0873d9596916fcb'/>
<id>urn:sha1:0183e13f505c0afa7cea9eb5a0873d9596916fcb</id>
<content type='text'>
If there aren’t any seats available, input is not possible (neither
keyboard nor mouse input).

Note that this is not the same thing as e.g. no keyboard being plugged
in. In this case, there will be a seat, but without the keybaord
capability. Input may not be possible _right now_, but may be later,
if the user plugs in a keyboard.

Closes #779
</content>
</entry>
<entry>
<title>foot/client: implement xdga client activation</title>
<updated>2021-11-01T01:52:29Z</updated>
<author>
<name>Ronan Pigott</name>
<email>rpigott@berkeley.edu</email>
</author>
<published>2021-10-29T00:51:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=99d5bf64bca5daa70e3e8c5a4d63a257ba7e6fb8'/>
<id>urn:sha1:99d5bf64bca5daa70e3e8c5a4d63a257ba7e6fb8</id>
<content type='text'>
This is an application of the xdg activation protocol that will allow
compositors to associate new foot toplevels with the command that
launched them.

footclient receives an activation token from the launcher which the
compositor can use to track application startup. It passes the token
to the foot server, which then activates the new window with the token
to complete the startup sequence.
</content>
</entry>
<entry>
<title>term: only scale using DPI if *all* monitors have a scaling factor or one</title>
<updated>2021-09-24T20:07:47Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-09-19T09:58:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fb77637eb96a71de48b49e40fbe7dd71ec85bcbf'/>
<id>urn:sha1:fb77637eb96a71de48b49e40fbe7dd71ec85bcbf</id>
<content type='text'>
With dpi-aware=auto (the default), scale fonts using DPI *only*
if *all* available monitors have a scaling factor of one.

The idea is this: if a user, with multiple monitors, have enabled
scaling on *at least* one monitor, he/she has most likely done so to
match the size of his/hers other monitors.

For example, if the user has one monitor with a scaling factor of one,
and another one with a scaling factor of two, he/she expects things to
be twice as large on the second monitor.

If we (foot) scale using DPI on the first monitor, and using the
scaling factor on the second monitor, foot will *not* look twice as
big on the second monitor (this was the old behavior of
dpi-aware=auto).

Part of #714
</content>
</entry>
<entry>
<title>wayland: set scale to 1 by default</title>
<updated>2021-07-26T09:18:37Z</updated>
<author>
<name>Nihal Jere</name>
<email>nihal@nihaljere.xyz</email>
</author>
<published>2021-07-26T02:46:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=52f50c556d485c99ff1d8e4f12d9f0499e283148'/>
<id>urn:sha1:52f50c556d485c99ff1d8e4f12d9f0499e283148</id>
<content type='text'>
The wl_output protocol specifies that the client should assume
that scale is 1 if not set by the compositor.
</content>
</entry>
<entry>
<title>wayland: prevent hang when terminating due to broken Wayland connection</title>
<updated>2021-07-24T18:38:56Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-24T18:31:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bcd28311f4e2625ae45a21bbcd1817cdcf5ce5f3'/>
<id>urn:sha1:bcd28311f4e2625ae45a21bbcd1817cdcf5ce5f3</id>
<content type='text'>
If the call to fdm_wayl() with EPOLLHUP was followed by calls to
wayl_roundtrip(), foot would hang.

The reason for this is that the EPOLLHUP handler in fdm_wayl() would
call wl_display_cancel_read().

wayl_roundtrip() also calls wl_display_cancel_read() (since we
normally have called wl_display_prepare_read()), before calling
wl_display_roundtrip().

When calling wl_display_cancel_read() two times in a row, without a
wl_display_prepare_read() in between, wl_display_roundtrip() hangs.

Fix by not calling wl_display_cancel_read() in fdm_wayl(). This
ensures our invariant holds: wl_display_prepare_read() is *always* in
effect outside of fdm_wayl().

Closes #651
</content>
</entry>
<entry>
<title>config: add csd.font option</title>
<updated>2021-07-24T09:02:43Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-22T21:21:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=50f59fe575f339b36c1abdeb74f85be776fcdc47'/>
<id>urn:sha1:50f59fe575f339b36c1abdeb74f85be776fcdc47</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: csd_title(): use a custom font, sized based on the title bar’s height</title>
<updated>2021-07-24T09:02:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-22T19:23:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0cf7a196163d51c344361bb2b79c145003dc3555'/>
<id>urn:sha1:0cf7a196163d51c344361bb2b79c145003dc3555</id>
<content type='text'>
We still use the primary font, but use a custom size, based on the
title bar’s height.

This fixes an issue where the window title could be way too small, or
way too big. And changed size when the terminal font size was changed.
</content>
</entry>
<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>
</feed>
