<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/render.c, branch 1.9.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.9.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.9.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2021-08-16T17:15:41Z</updated>
<entry>
<title>selection: don’t require two cell attr bits for selection updating</title>
<updated>2021-08-16T17:15:41Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-13T15:45:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ae70596a5034f9fd6bbca6b42e4fe52c42c70d34'/>
<id>urn:sha1:ae70596a5034f9fd6bbca6b42e4fe52c42c70d34</id>
<content type='text'>
When updating the selection (i.e when changing it - adding or removing
cells to the selection), we need to do two things:

* Unset the ‘selected’ bit on all cells that are no longer selected.
* Set the ‘selected’ bit on all cells that *are* selected.

Since it’s quite tricky to calculate the difference between the “old”
and “new” selection, this is done by first un-selecting the old
selection, and then selecting the new, updated selection. I.e. first
we clear the ‘selected’ bit from *all* cells, and then we re-set it on
those cells that are still selected.

This process also dirties the cells, to make sure they are
re-rendered (needed to reflect their new selected/un-selected status).

To avoid dirtying *all* previously selected, and newly selected cells,
we have used an algorithm that first runs a “pre-pass”, marking all
cells that *will* be selected as such. The un-select pass would then
skip (no dirty) cells that have been marked by the pre-pass. Finally,
the select pass would only dirty cells that have *not* been marked by
the pre-pass.

In short, we only dirty cells whose selection state have *changed*.

To do this, we used a second ‘selected’ bit in the cell attribute
struct.

Those bits are *scarce*.

This patch implements an alternative algorithm, that frees up one of
the two ‘selected’ bits.

This is done by lazy allocating a bitmask for the entire grid. The
pre-pass sets bits in the bitmask. Thus, after the pre-pass, the
bitmask has set bits for all cells that *will* be selected.

The un-select pass simply skips cells with a one-bit in the
bitmask. Cells without a one-bit in the bitmask are dirtied, and their
‘selected’ bit is cleared.

The select-pass doesn’t even have to look at the bitmask - if the cell
already has its ‘selected’ bit set, it does nothing. Otherwise it sets
it and dirties the cell.

The bitmask is implemented as an array of arrays of 64-bit
integers. Each outer element represents one row. These pointers are
calloc():ed before starting the pre-pass.

The pre-pass allocates the inner arrays on demand.

The unselect pass is designed to handle both the complete absence of a
bitmask, as well as row entries being NULL (both means the cell
is *not* pre-marked, and will thus be dirtied).
</content>
</entry>
<entry>
<title>render: run the “overflowing glyphs” prepass *before* rendering sixels</title>
<updated>2021-08-11T16:26:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-10T16:33:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=41a8f2fc6556e7b8c9832ede21c6b45f624207cf'/>
<id>urn:sha1:41a8f2fc6556e7b8c9832ede21c6b45f624207cf</id>
<content type='text'>
This fixes an issue where the left-most column of a sixel was
“overwritten” by the cell content.

This patch also rewrites the prepass logic, to try to reduce the
number of loads performed.

The new logic loops each row from left to right, looking for dirty
cells. When a dirty cell is found, we first scan backwards, until we
find a non-overflowing cell. That cell is unaffected by the
overflowing cell we’re currently dealing with.

We can also stop as soon as we see a dirty cell, since that cell will
already have been dealt with.

Then, we scan forward, dirtying cells until we see a non-overflowing
cell. That first non-overflowing cell is also dirtied, but after that
we break.

The last loop, that scans forward, advances the same cell pointer used
in the outer loop.
</content>
</entry>
<entry>
<title>box-drawing: add U+1FB3C-U+1FB6F, U+1FB9A and U+1FB9B</title>
<updated>2021-08-05T16:25:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-03T16:10:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1c43fdbea4751de9a84d24be8320712c85045414'/>
<id>urn:sha1:1c43fdbea4751de9a84d24be8320712c85045414</id>
<content type='text'>
These are the “wedges” from the Unicode 13 “Legacy Computing” symbols.

Closes #474
</content>
</entry>
<entry>
<title>term: consolidate shutdown related state into an anonymous struct</title>
<updated>2021-07-31T17:08:51Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-31T17:08:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=03f952cf4dcf45d909ce209838a3beb4304358e5'/>
<id>urn:sha1:03f952cf4dcf45d909ce209838a3beb4304358e5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: asynchronous client application termination</title>
<updated>2021-07-31T16:18:48Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-31T16:18:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=384b1c330ffbee4318ee75c97186450f0f6e9e35'/>
<id>urn:sha1:384b1c330ffbee4318ee75c97186450f0f6e9e35</id>
<content type='text'>
When the foot window is closed, and we need to terminate the client application,
do this in an asynchronous fashion:

* Don’t do a blocking call to waitpid(), instead, rely on the reaper callback
* Use a timer FD to implement the timeout before sending SIGKILL (instead of
  using SIGALRM).
* Send SIGTERM immediately (we used to *just* close the PTY, and then wait 2
  seconds before sending SIGTERM).
* Raise the timeout from 2 seconds to 60

Full shutdown now depends on *two* asynchronous tasks - unmapping the window,
and waiting for the client application to terminate.

Only when *both* of these have completed do we proceed and call term_destroy(),
and the user provided shutdown callback.
</content>
</entry>
<entry>
<title>Only brighten palette colors with bold-text-in-bright=palette-based</title>
<updated>2021-07-26T17:13:46Z</updated>
<author>
<name>David Rosca</name>
<email>nowrep@gmail.com</email>
</author>
<published>2021-07-22T16:22:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2c5a23867fd7bcfe4cf757cb690fcd6dc191ec6e'/>
<id>urn:sha1:2c5a23867fd7bcfe4cf757cb690fcd6dc191ec6e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: render_osd(): use fcft_text_run_rasterize(), if available</title>
<updated>2021-07-24T09:02:43Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-22T21:35:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7714fcde83c223f8143bb406eb2e2541ee932c4a'/>
<id>urn:sha1:7714fcde83c223f8143bb406eb2e2541ee932c4a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: render_osd(): fix rendering of color bitmap glyphs</title>
<updated>2021-07-24T09:02:43Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-22T21:27:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e2e28db7deb762830bf3a3d178a561b8e683ff8a'/>
<id>urn:sha1:e2e28db7deb762830bf3a3d178a561b8e683ff8a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: render_osd(): don’t re-instantiate foreground color for each glyph</title>
<updated>2021-07-24T09:02:43Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-22T21:27:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bf285ae00a749147fa15ac86bc38e8b1d7cae217'/>
<id>urn:sha1:bf285ae00a749147fa15ac86bc38e8b1d7cae217</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: render_osd(): don’t assume a monospace font</title>
<updated>2021-07-24T09:02:43Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-22T21:26:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5c683d2c089e4b30b35d0f5b9c816e1a88ae6e10'/>
<id>urn:sha1:5c683d2c089e4b30b35d0f5b9c816e1a88ae6e10</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: render_osd() now needs a ‘font’ argument</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:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4a41575cb5d2738cf1fb341f0d4413dee1bf67cc'/>
<id>urn:sha1:4a41575cb5d2738cf1fb341f0d4413dee1bf67cc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: render_osd(): pass font as argument</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:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5fe23c0215502b41fb40032a89d55e574e73169f'/>
<id>urn:sha1:5fe23c0215502b41fb40032a89d55e574e73169f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: refresh CSD in render_refresh_title(), not render_update_title()</title>
<updated>2021-07-24T09:02:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-22T17:34:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3d9536caff354e30bea463f4a7e617a9aa11ebc7'/>
<id>urn:sha1:3d9536caff354e30bea463f4a7e617a9aa11ebc7</id>
<content type='text'>
This fixes an issue where the CSD title sometimes got stuck on an
“old” title.
</content>
</entry>
<entry>
<title>render: refresh CSDs when updating the title</title>
<updated>2021-07-24T09:02:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-22T17:27:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=61e4035c23ef61a0fcca5f56a8ac50afa64349ea'/>
<id>urn:sha1:61e4035c23ef61a0fcca5f56a8ac50afa64349ea</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: csd_title(): use render_osd() to render the current window title</title>
<updated>2021-07-24T09:02:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-22T17:25:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=468587b67f1c9c8dee6896d4319f0282a01ecb0d'/>
<id>urn:sha1:468587b67f1c9c8dee6896d4319f0282a01ecb0d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: must now set alpha in bg color when calling render_osd()</title>
<updated>2021-07-24T09:02:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-22T17:24:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bbc26da87b821fcab684a9c1dfaa52d0538b278b'/>
<id>urn:sha1:bbc26da87b821fcab684a9c1dfaa52d0538b278b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: render_osd(): set clip region, use background alpha</title>
<updated>2021-07-24T09:02:41Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-22T17:22:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7067c57399177c0559658086cbf7997fe3b8057a'/>
<id>urn:sha1:7067c57399177c0559658086cbf7997fe3b8057a</id>
<content type='text'>
Set clip region in render_osd(). This ensures we don’t step outside
the pixman buffer when rendering the glyphs.

Furthermore, don’t ignore the alpha channel in the background color.

Move render_osd() to make it visible to the render_csd_*() functions.
</content>
</entry>
<entry>
<title>render: color_dim(): retain alpha channel</title>
<updated>2021-07-24T09:02:41Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-22T17:22:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e17c6fcbecf67a75bf8cd37995fac0e937b934cc'/>
<id>urn:sha1:e17c6fcbecf67a75bf8cd37995fac0e937b934cc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: prevent cells from overflowing into margin</title>
<updated>2021-07-20T09:44:27Z</updated>
<author>
<name>Timur Celik</name>
<email>mail@timurcelik.de</email>
</author>
<published>2021-07-20T09:12:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a410734f9605252776d4a5f6d82b65e6fd9e4d1d'/>
<id>urn:sha1:a410734f9605252776d4a5f6d82b65e6fd9e4d1d</id>
<content type='text'>
</content>
</entry>
</feed>
