<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/terminal.c, branch 1.15.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.15.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.15.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2023-07-03T12:36:33Z</updated>
<entry>
<title>term_xcursor_update_for_seat(): fix missing evaluation of render_xcursor_is_valid()</title>
<updated>2023-07-03T12:36:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-03T12:26:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ba09d55aabb8979a305c13afe8d51f98e5118410'/>
<id>urn:sha1:ba09d55aabb8979a305c13afe8d51f98e5118410</id>
<content type='text'>
When compiling *without* cursor-shape-v1 support,
term_xcursor_update_for_seat() would incorrectly set
shape=CURSOR_SHAPE_CUSTOM, even though no custom cursor had been set
by the user.

This resulted in a crash in render_xcursor_set(), when trying to use a
NULL-string as custom cursor.
</content>
</entry>
<entry>
<title>terminal: #elif -&gt; #else</title>
<updated>2023-07-03T12:36:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-29T14:06:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7bfa700c556c529036646e3224c6969e845840f6'/>
<id>urn:sha1:7bfa700c556c529036646e3224c6969e845840f6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>cursor-shape: use server-side cursors for custom (OSC-22), if possible</title>
<updated>2023-07-03T12:36:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-28T11:25:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c2baaff3c1311335b46e75db27bfd79d4f7b623b'/>
<id>urn:sha1:c2baaff3c1311335b46e75db27bfd79d4f7b623b</id>
<content type='text'>
Using a lookup table, try to map the user-provided xcursor string to a
cursor-shape-v1 known shape.

If we succeed, set the user’s custom cursor using server side
cursors (i.e. using cursor-shape-v1).

If not, fallback to trying to load the image ourselves (using
wl_cursor_theme_get_cursor()), and set it using the legacy
wl_pointer_set_cursor().
</content>
</entry>
<entry>
<title>render: don’t (can’t) use cursor-shape-v1 when user has set a custom cursor</title>
<updated>2023-07-03T12:36:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-27T16:40:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ddd6004b275dd9a24f26e03dead90f0fffb0cc3e'/>
<id>urn:sha1:ddd6004b275dd9a24f26e03dead90f0fffb0cc3e</id>
<content type='text'>
Well, we _could_, but we’d have to reverse map the string to a
cursor-shape-v1 enum value. Let’s not do that, for now at least.
</content>
</entry>
<entry>
<title>refactor: track current xcursor using an enum, instead of a char pointer</title>
<updated>2023-07-03T12:36:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-27T14:57:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ee794a121e4603d01fb662ad6d1f3b18b6937d2c'/>
<id>urn:sha1:ee794a121e4603d01fb662ad6d1f3b18b6937d2c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>sixel: re-scale images when the cell dimensions change</title>
<updated>2023-06-30T06:29:35Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-29T12:49:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=49fb0cf359bb2486bbdf58df62c66c890d7e31cd'/>
<id>urn:sha1:49fb0cf359bb2486bbdf58df62c66c890d7e31cd</id>
<content type='text'>
Before this patch, when the cell dimensions changed (i.e. when the
font size changes), sixel images were either removed (the new cell
dimensions are smaller than the old), or simply kept at their original
size (new cell dimensions are larger).

With this patch, sixels are instead resized. This means a
sixel *always* occupies the same number of rows and columns,
regardless of how much the font size is changed.

This is done by maintaining two sets of image data and pixman images,
as well as their dimensions. These two sets are the new ‘original’ and
‘scaled’ members of the sixel struct.

The "top-level" pixman image pointer, and the ‘width’ and ‘height’
members either point to the "original", or the "scaled" version.

They are invalidated as soon as the cell dimensions change. They, and
the ‘scaled’ image is updated on-demand (when we need to render a
sixel).

Note that the ‘scaled’ image is always NULL when the current cell
dimensions matches the ones used when emitting the sixel (to save
run-time memory).

Closes #1383
</content>
</entry>
<entry>
<title>config: dpi-aware: remove ‘auto’ value, and default to ‘no’</title>
<updated>2023-06-29T13:38:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-26T15:55:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=64b6b5d2a7b81bcad3f0a50a6c1556fd7300c171'/>
<id>urn:sha1:64b6b5d2a7b81bcad3f0a50a6c1556fd7300c171</id>
<content type='text'>
We now default to scaling fonts using the scaling factor, not monitor
DPI.

The ‘auto’ value for dpi-aware has been removed.

Documentation (man pages and README) have been updated to reflect the
new default.
</content>
</entry>
<entry>
<title>wayland: refactor: wrap wl_surface pointers in a wayl_surface struct</title>
<updated>2023-06-29T13:38:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-26T14:10:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ba46a039aca734bb284c22ba5d5bddf5407e3848'/>
<id>urn:sha1:ba46a039aca734bb284c22ba5d5bddf5407e3848</id>
<content type='text'>
And add a viewport object to accompany the surface (to be used when
scaling the surface).

Also rename the wl_surf_subsurf struct to wayl_sub_surface, and add a
wayl_surface object to it, rather than a plain wl_surface pointer (to
also get the viewport pointer).
</content>
</entry>
<entry>
<title>term: reload_fonts(): ‘scale’ is not a float</title>
<updated>2023-06-29T13:38:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-22T12:39:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=424d0450840bc3db018457787fcdf93db101b265'/>
<id>urn:sha1:424d0450840bc3db018457787fcdf93db101b265</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: scroll: only record scroll damage when viewport is at the bottom</title>
<updated>2023-06-23T18:38:03Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-23T18:20:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8a3620bafaa4119b9f6d3f74189c2dac78614d3c'/>
<id>urn:sha1:8a3620bafaa4119b9f6d3f74189c2dac78614d3c</id>
<content type='text'>
We don’t need to record scroll damage if the viewport isn’t at the
bottom, since in this case, the renderer ignores the scroll damage
anyway.

This fixes a performance corner case, when the viewport is at the top
of the scrollback history.

When application scrolls the terminal contents, and the scrollback
history is full, and the viewport is at top of the history, then the
viewport needs to be moved (the scrollback history is a circular
buffer, and thus the top of the history “moves” when we’re scrolling
in new contents).

Moving the viewport typically results in another type of scroll
damage (DAMAGE_SCROLL_IN_VIEW, instead of the “normal” DAMAGE_SCROLL).

Thus, each application triggered scroll, will result in two scroll
damage records: one DAMAGE_SCROLL, and one
DAMAGE_SCROLL_IN_VIEW. These two are incompatible, meaning they can’t
be merged. What’s worse, it also means the DAMAGE_SCROLL records from
two application triggered scrolls cannot be merged (since there’s a
DAMAGE_SCROLL_IN_VIEW in between).

As a result, the renderer will not see one, or “a few” scroll damage
events, but a *ton*. _Each_ one typically a single line, or so. And
each one resulting in lots of traffic on the wayland socket, as we
create and destroy new buffer pools, when doing “shm scrolling”.

This eventually leads to the socket not being able to keep up, and the
socket is closed on us, forcing us to exit.

The fix is really simple: don’t record “normal” scroll damage when
scrolling, _unless_ the viewport is at the bottom (and thus “follows”
the application output).

As soon as the user scrolls up in the history, we’ll stop emitting
normal scroll damage records. This is just fine, since, as mentioned
above, the renderer ignores them when the viewport isn’t at the
bottom.

What if the viewport is moved back down again, before the next frame
has been rendered? Wont there be “missing” scroll damage records? No,
because moving the viewport results in scroll damage records by
itself.

Closes #1380
</content>
</entry>
<entry>
<title>term: add term_cursor_col()</title>
<updated>2023-06-20T12:55:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-16T14:33:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=24f12c7b5e753a5152eac44da9024954d43250e9'/>
<id>urn:sha1:24f12c7b5e753a5152eac44da9024954d43250e9</id>
<content type='text'>
Set cursor column, absolute.

term_cursor_to() needs to reload the current row pointer, and is thus
not very effective when we only need to modify the column.
</content>
</entry>
<entry>
<title>utmp: rewrite utmp logging</title>
<updated>2023-05-22T16:47:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-05-17T18:51:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e78319fccd2b8c057deff4b1937b325be1d35140'/>
<id>urn:sha1:e78319fccd2b8c057deff4b1937b325be1d35140</id>
<content type='text'>
This patch generalizes the utmp support, to not only support
libutempter, but also ulog (and in the future, even more interfaces).

* Rename config option main.utempter to main.utmp-helper
* Add meson option -Dutmp-backend=none|libutempter|ulog|auto
* Rename meson option -Ddefault-utempter-path to -Dutmp-default-helper-path
* utmp is no longer detected at compile time, but at runtime instead.

Meson will configure the following pre-processor macros, based on the
selected utmp backend:

* UTMP_ADD - argument to pass to utmp helper when adding a record (starting foot)
* UTMP_DEL - argument to pass to utmp helper when removing a record (exiting foot)
* UTMP_DEL_HAVE_ARGUMENT - if defined, UTMP_DEL expects an extra argument ($WAYLAND_DISPLAY)
* UTMP_DEFAULT_HELPER_PATH - path to the default utmp helper binary

The documentation has been updated to mention which arguments are
passed to the helper binary.

Closes #1314
</content>
</entry>
<entry>
<title>quirks: sway does not damage surface beneath sub-surface, when unmapped</title>
<updated>2023-05-12T12:51:05Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-04-25T19:33:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3b41379be43a21a00a776d0d136c5d1b2fe4007e'/>
<id>urn:sha1:3b41379be43a21a00a776d0d136c5d1b2fe4007e</id>
<content type='text'>
When unmapping a sub-surface, Sway &lt;= 1.8 does not damage the surface
beneath the sub-surface.

https://github.com/swaywm/sway/issues/6960

The workaround is to manually damage the main surface. Previously,
this was done when exiting scrollback search, and after the ‘flash’
OSC. But other sub-surfaces, that may also be unmapped, did not.

This patch adds a quirk handler that does this, and calls it when:

* Exiting scrollback search
* Ending the ‘flash’ OSC
* Exiting unicode input mode
* Clearing URL labels
* Removing the scrollback position indicator

Closes #1335
</content>
</entry>
<entry>
<title>term: reset: switch modifyOtherKeys back to level 1</title>
<updated>2023-05-12T07:42:35Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-05-12T07:42:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7eea69df8928ff0f0ea481ff62d8a9166151509f'/>
<id>urn:sha1:7eea69df8928ff0f0ea481ff62d8a9166151509f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: ensure scroll region’s endpoint is valid after a window resize</title>
<updated>2023-04-12T15:57:53Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-04-12T14:39:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e2baa6523875aaa13b6b7db80b7985978b8ee492'/>
<id>urn:sha1:e2baa6523875aaa13b6b7db80b7985978b8ee492</id>
<content type='text'>
If we had a non-empty bottom scroll region, and the window was resized
to a smaller size, the scroll region was not reset correctly.

This led to a crash when scrolling the screen content.

Fix by making sure the scroll region’s endpoint is within range.
</content>
</entry>
<entry>
<title>term: protect against integer overflow when accumulating scroll damage</title>
<updated>2023-03-30T14:13:19Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-03-28T16:37:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=981e4b77cb96ab277ea3b7a1e8aebf0e4589c032'/>
<id>urn:sha1:981e4b77cb96ab277ea3b7a1e8aebf0e4589c032</id>
<content type='text'>
When accumulating scroll damage, we check if the last scroll damage’s
scrolling region, and type, matches the new/current scroll damage. If
so, the number of lines in the last scroll damage is increased,
instead of adding a new scroll damage instance to the list.

If the scroll damage list isn’t consumed, this build up of scroll
damage would eventually overflow.

And, even if it didn’t overflow, it could become large enough, that
when later used to calculate e.g. the affected surface area, while
rendering a frame, would cause an overflow there instead.

This patch fixes both issues by:

a) do an overflow check before increasing the line count
b) limit the line count to UINT16_MAX
</content>
</entry>
<entry>
<title>config: add ‘font-size-adjustment=N[px|%]’ option</title>
<updated>2022-12-17T09:59:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-12-15T10:10:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f6ca8c90e11d9b1ecdfe8a5bf69b1b793376a91c'/>
<id>urn:sha1:f6ca8c90e11d9b1ecdfe8a5bf69b1b793376a91c</id>
<content type='text'>
This patch adds a new config option, font-size-adjustment.

It lets you configure how much the font size should be
incremented/decremented when zooming in or out (ctrl-+, ctrl+-).

Values can be specified in points, pixels or percent.

Closes #1188
</content>
</entry>
<entry>
<title>term: apply scale factor when converting a px value to pt</title>
<updated>2022-11-24T16:20:05Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-11-24T16:20:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fa6b07abeacfb5b8a70bc762e9c8ff64470c4d2c'/>
<id>urn:sha1:fa6b07abeacfb5b8a70bc762e9c8ff64470c4d2c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: initialize term-&gt;font_line_height when there’s no user-set line-height</title>
<updated>2022-11-24T16:09:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-11-24T16:09:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e85257bcae116f5e6148e38690e2ec95b586d451'/>
<id>urn:sha1:e85257bcae116f5e6148e38690e2ec95b586d451</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: update user-set line-height just before calculating the cell dimensions</title>
<updated>2022-11-24T13:34:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-11-24T13:34:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=94bac0513ab3ca78464d8e79c153c8ee4bac835f'/>
<id>urn:sha1:94bac0513ab3ca78464d8e79c153c8ee4bac835f</id>
<content type='text'>
This ensures *all* font-size affecting changes (DPI, output scaling,
font size increment/decrement) also updates the line-height.
</content>
</entry>
</feed>
