<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/render.c, branch 1.6.3</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.6.3</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.6.3'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2021-01-29T18:39:48Z</updated>
<entry>
<title>Send text_input_rectangle requests for text-input</title>
<updated>2021-01-29T18:39:48Z</updated>
<author>
<name>Tadeo Kondrak</name>
<email>me@tadeo.ca</email>
</author>
<published>2020-12-20T22:01:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8f0a3ee7a9cbb1b0fc8011875a0895bfd331e0a8'/>
<id>urn:sha1:8f0a3ee7a9cbb1b0fc8011875a0895bfd331e0a8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ime: fix rendering of pre-edit cursor when positioned after the pre-edit string</title>
<updated>2021-01-26T19:46:59Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-25T20:57:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=adbf036053db00ef474ae53eadae93f901a1459e'/>
<id>urn:sha1:adbf036053db00ef474ae53eadae93f901a1459e</id>
<content type='text'>
We failed to convert the byte-indices to cell indices, resulting in a
box cursor covering the entire pre-edit string.

Note that in addition to fixing the translation from byte index to
cell index, the rendered had to be updated to dirty one extra cell
from the original grid.

Without this, we left trailing cursors behind us when the user deleted
text from the pre-edit string.
</content>
</entry>
<entry>
<title>search: ad-hoc workaround for combining characters with positive x-offsets</title>
<updated>2021-01-26T19:46:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-25T09:00:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f9a43209f2481cf31fe39c08fdfa7ce27cbfcab2'/>
<id>urn:sha1:f9a43209f2481cf31fe39c08fdfa7ce27cbfcab2</id>
<content type='text'>
When rendering the search input box, do the same ad-hoc workaround for
combining characters with a positive x-offset as we do when rendering
normal grid cells.

In this case, we don’t *know* when we’re dealing with combining
characters. But we can detect zero-width characters. For these, check
their glyph’s x-offset. If positive, adjust it like we do when
rendering combining glyphs in the main grid, to ensure the glyph is
positioned over the _previous_ character, not the next.
</content>
</entry>
<entry>
<title>render: set thread name in a portable way</title>
<updated>2021-01-23T09:16:40Z</updated>
<author>
<name>Jan Beich</name>
<email>jbeich@FreeBSD.org</email>
</author>
<published>2021-01-19T14:49:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9b09049c1ccfe70cfdadb1de92c0115b283f986d'/>
<id>urn:sha1:9b09049c1ccfe70cfdadb1de92c0115b283f986d</id>
<content type='text'>
prctl is Linux-only but pthread_setname_np is same as PR_SET_NAME.
Solaris and FreeBSD &gt;= 13 have pthread_setname_np similar to Linux.
DragonFly, OpenBSD, FreeBSD &lt; 13 lack pthread_setname_np but provide
pthread_set_name_np which doesn't return a value. NetBSD requires 3
arguments for pthread_setname_np where the last one is void *.

render.c:8:10: fatal error: 'sys/prctl.h' file not found
 #include &lt;sys/prctl.h&gt;
          ^~~~~~~~~~~~~
render.c:1234:9: error: implicit declaration of function 'prctl' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if (prctl(PR_SET_NAME, proc_title, 0, 0, 0) &lt; 0)
        ^
render.c:1234:15: error: use of undeclared identifier 'PR_SET_NAME'
    if (prctl(PR_SET_NAME, proc_title, 0, 0, 0) &lt; 0)
              ^
</content>
</entry>
<entry>
<title>render: sixel: fix assertion: x/y coords may be outside visible area</title>
<updated>2021-01-21T10:53:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-06T15:57:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=44d7242d1460543b720bfb537805798dcead987e'/>
<id>urn:sha1:44d7242d1460543b720bfb537805798dcead987e</id>
<content type='text'>
But when they are, width/height must be 0.
</content>
</entry>
<entry>
<title>render: codespell: accomodate -&gt; accommodate</title>
<updated>2021-01-21T10:53:10Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-04T18:49:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8953840e385fea4ddd31647e7724db6870149bdd'/>
<id>urn:sha1:8953840e385fea4ddd31647e7724db6870149bdd</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: draw combining characters on top of colored bitmap glyphs (emoji)</title>
<updated>2021-01-21T10:53:05Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-04T17:32:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d10fc3dc797708127ff235a60c0f26627885baa3'/>
<id>urn:sha1:d10fc3dc797708127ff235a60c0f26627885baa3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: mark cell overflowed into as dirty</title>
<updated>2021-01-21T10:46:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-02T21:24:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9c705b26ee2cefe8e9710c6dc8dbbd1ac5a5c53f'/>
<id>urn:sha1:9c705b26ee2cefe8e9710c6dc8dbbd1ac5a5c53f</id>
<content type='text'>
When tweak.allow-overflowing-double-width-glyphs=yes, then certain
glyphs are allowed to overflow into the neighbouring cell.

However, if the cell “owning” the double-width glyph is erased (_only_
that cell), then the cell overflowed into is not redrawn, causing
part of the double-width glyph to remain on screen.

To avoid checking for these glyphs when printing to the terminal (i.e
at parse time), simply mark both cells as dirty when we render the
overflowing glyph.

Yes, this means that the cells will always be re-rendered. We count on
them only making up a small portion of the screen.
</content>
</entry>
<entry>
<title>render: fix rounding error when calculating background color with alpha</title>
<updated>2020-12-20T14:46:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-20T11:25:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a2ce0622c5396774c64245bb6cbd6b7dbd0d339d'/>
<id>urn:sha1:a2ce0622c5396774c64245bb6cbd6b7dbd0d339d</id>
<content type='text'>
We use pre-multiplied alpha color channels, but were having bad
rounding errors due to the alpha divider being truncated to an
integer.

The algorithm for pre-multiplying a color channel is:

  alpha_divider = 0xffff / alpha
  pre_mult_color = color / alpha_divider

In order to fix the rounding errors, we could turn ‘alpha_divider’
into a double.

That however would introduce a performance penalty since now we’d need
to do floating point math for each cell.

The algorithm can be trivially converted to:

  pre_mult_color = color * alpha / 0xffff

Since both color and alpa values are &lt; 65536, the multiplication is
“safe”; it will not overflow an uint32_t.

Closes #249
</content>
</entry>
<entry>
<title>render: ime: ensure cursor is visible</title>
<updated>2020-12-08T18:17:46Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-08T18:17:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ae01caee8ce4678de945fc18e97b95feced5fde1'/>
<id>urn:sha1:ae01caee8ce4678de945fc18e97b95feced5fde1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: search: render IME pre-edit text correctly, hopefully</title>
<updated>2020-12-07T19:44:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-07T17:58:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b270f221d0328651fdac46cf081e2cbce4d74f4c'/>
<id>urn:sha1:b270f221d0328651fdac46cf081e2cbce4d74f4c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: ime: adjust cursor cell index when adjusting glyph offset</title>
<updated>2020-12-07T19:44:15Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-06T11:24:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bcfc468fd0037ddeee64d3cf24602b570bacef3c'/>
<id>urn:sha1:bcfc468fd0037ddeee64d3cf24602b570bacef3c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: ime: wip: pre-edit</title>
<updated>2020-12-07T19:44:14Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-06T11:18:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d46dcd8ef54eba88dd76570e4b9fd2da284523e9'/>
<id>urn:sha1:d46dcd8ef54eba88dd76570e4b9fd2da284523e9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: search: don’t access term-&gt;search.buf[] directly</title>
<updated>2020-12-07T19:44:14Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-05T22:34:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7c420004fb2db841b8c800494c865e14b3ecaffe'/>
<id>urn:sha1:7c420004fb2db841b8c800494c865e14b3ecaffe</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: codespell: cound -&gt; count</title>
<updated>2020-12-07T19:44:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-05T22:34:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1ea36740290162dfda5659b04ac364b0272a3423'/>
<id>urn:sha1:1ea36740290162dfda5659b04ac364b0272a3423</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: search: glyph_offset is in *cells*, cursor position in *characters*</title>
<updated>2020-12-07T19:44:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-05T22:29:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b4a0f5b13b44525bd1dbdbc12e4e412fc9a0a1cb'/>
<id>urn:sha1:b4a0f5b13b44525bd1dbdbc12e4e412fc9a0a1cb</id>
<content type='text'>
When calculating the offset into the search string, from where to
start rendering, take into account that the cursor position is
in *characters*, and the glyph-offset is in *cells*.
</content>
</entry>
<entry>
<title>render: search: wcsnlen() -&gt; wcswidth()</title>
<updated>2020-12-07T19:44:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-05T21:51:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5ffa65a2e307e2442303d9d0ff2c2e05a1a8eca4'/>
<id>urn:sha1:5ffa65a2e307e2442303d9d0ff2c2e05a1a8eca4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: search: handle multi-column characters</title>
<updated>2020-12-07T19:44:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-05T10:59:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a552610fdb721980bc455c7dc8636bc13d8f698b'/>
<id>urn:sha1:a552610fdb721980bc455c7dc8636bc13d8f698b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: search: render colorized glyphs (emojis) correctly</title>
<updated>2020-12-07T19:44:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-05T10:59:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=dca35215d079d11f0138a4cd2c98b76b39524a20'/>
<id>urn:sha1:dca35215d079d11f0138a4cd2c98b76b39524a20</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: ime: don’t render pre-edit string in grid while searching</title>
<updated>2020-12-07T19:44:12Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-12-05T10:42:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9ce0edc8bbcbdc5d269bdf573e20d959878ffa85'/>
<id>urn:sha1:9ce0edc8bbcbdc5d269bdf573e20d959878ffa85</id>
<content type='text'>
While doing a scrollback search, the pre-edit string should be
rendered in the search box, not in the grid.

Note that we don’t yet support IME in scrollback search mode. This
patch simply prevents the pre-edit text being rendered in the grid,
in the “background”, while searching.
</content>
</entry>
</feed>
