<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/render.c, branch 1.1.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.1.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.1.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2020-01-12T13:42:49Z</updated>
<entry>
<title>render: resize: TIOCSWINSZ: don't include padding in ws_{x,y}pixel</title>
<updated>2020-01-12T13:42:49Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-12T13:42:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=727be358df89f2a8871d3f116e57acc9c0f2e6ec'/>
<id>urn:sha1:727be358df89f2a8871d3f116e57acc9c0f2e6ec</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: shorten application_synchronized_updates -&gt; app_sync_updates</title>
<updated>2020-01-12T11:55:19Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-12T11:55:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1623fc0c0a9b7b86ae633776d84f2b56b158976a'/>
<id>urn:sha1:1623fc0c0a9b7b86ae633776d84f2b56b158976a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term/render: move {enable,disable}_application_synchronized_updates()</title>
<updated>2020-01-12T11:43:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-12T11:43:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bdf127fc7e26585cfddc73193751996033bbe88c'/>
<id>urn:sha1:bdf127fc7e26585cfddc73193751996033bbe88c</id>
<content type='text'>
From render -&gt; terminal
</content>
</entry>
<entry>
<title>render: add a timeout for application synchronized updates</title>
<updated>2020-01-12T11:40:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-12T11:40:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=afa1dbb7cc98277d8ee22e4bc5a2b3ee2c774662'/>
<id>urn:sha1:afa1dbb7cc98277d8ee22e4bc5a2b3ee2c774662</id>
<content type='text'>
This ensures we can recover from a crashing (or bad behaving)
application that sends a BSU but then never sends an ESU.
</content>
</entry>
<entry>
<title>render: rename render_{enable,disable}_refresh()</title>
<updated>2020-01-12T11:28:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-12T11:28:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6e474e77e50510d825bc6bf8fd60fad17b66a40d'/>
<id>urn:sha1:6e474e77e50510d825bc6bf8fd60fad17b66a40d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: rename refresh_prohibited -&gt; application_synchronized_updates</title>
<updated>2020-01-12T11:25:58Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-12T11:25:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=cb8a0260f347cd73c7942030aa2bd12f9355ab17'/>
<id>urn:sha1:cb8a0260f347cd73c7942030aa2bd12f9355ab17</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: add render_{enable,disable}_refresh()</title>
<updated>2020-01-12T11:19:38Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-12T11:19:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b2935e2b89cf999d64a6322f58d6bf4307371463'/>
<id>urn:sha1:b2935e2b89cf999d64a6322f58d6bf4307371463</id>
<content type='text'>
Calling render_disable_refresh() causes update requests to that
terminal to be ignored.

Calling render_enable_refresh() re-enables updates.
</content>
</entry>
<entry>
<title>render: don't bother trying to lookup glyph for empty cells</title>
<updated>2020-01-12T00:19:41Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-12T00:19:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0b30316261867fdf79f6b847ba4965e1d787adcd'/>
<id>urn:sha1:0b30316261867fdf79f6b847ba4965e1d787adcd</id>
<content type='text'>
Depending on the font, it may not have an entry for code point '0',
which will cause us to try to load fallback fonts.
</content>
</entry>
<entry>
<title>selection: update: don't dirty cells that don't change state</title>
<updated>2020-01-06T10:56:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-06T10:56:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=457eb573c441826d4b3843c6c0ad36de097f17d7'/>
<id>urn:sha1:457eb573c441826d4b3843c6c0ad36de097f17d7</id>
<content type='text'>
Previously when updating a selection, we would unmark *all* cells in
the old selection, and then mark all cells in the new selection.

This caused *all* cells to be dirtied and thus re-rendered.

Avoid this, by adding a temporary state to the cells' selected state.

Before unmarking the old selection, pre-mark the new selection using a
temporary state.

When unmarking the old selection, ignore cells in this temporary state.
When marking the new selection, ignore cells in this temporary
state (except clearing the temporary state).
</content>
</entry>
<entry>
<title>search: rename render.search_offset -&gt; render.search_glyph_offset</title>
<updated>2020-01-05T14:25:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-05T14:25:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7e178d63374fd26da27ed9cc862b4b88443d1917'/>
<id>urn:sha1:7e178d63374fd26da27ed9cc862b4b88443d1917</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: ensure cursor is always visible in the search box</title>
<updated>2020-01-05T14:16:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-05T14:16:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5a895202740963971423ee27d5c0f77a4a3f84cc'/>
<id>urn:sha1:5a895202740963971423ee27d5c0f77a4a3f84cc</id>
<content type='text'>
Maintain a view 'offset' (which glyph from the search string to start
rendering at).

This defines the start of the viewable area. The end is the offset +
the search box size (which is limited to the window size).

Adjust this offset whenever the cursor moves outside the viewable
area. For now, this is always done in the same way: set the offset to
the cursor position.

This means that when we're entering text at the end of the search
criteria (i.e. the normal case; we're simply typing), and the search
box reaches the window size, the cursor will jump to the start of the
search box, which will be empty. This could be confusing, but let's go
with for now.
</content>
</entry>
<entry>
<title>render: xcursor: remove render_xcursor_refresh()</title>
<updated>2020-01-04T23:10:44Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T23:10:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f4e8a9c37525c184fcc78985f7d8e9818a2cbc3f'/>
<id>urn:sha1:f4e8a9c37525c184fcc78985f7d8e9818a2cbc3f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>renderer: destroy: actually free the renderer instance (doh!)</title>
<updated>2020-01-04T22:41:26Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T22:41:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=30ce5ad386a44f405802cbe5b62e348922a61272'/>
<id>urn:sha1:30ce5ad386a44f405802cbe5b62e348922a61272</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: use a low priority FDM hook to flush the wayland socket</title>
<updated>2020-01-04T22:27:59Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T22:27:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4cbd894803f239af3e320aece24521aeb325cbd2'/>
<id>urn:sha1:4cbd894803f239af3e320aece24521aeb325cbd2</id>
<content type='text'>
This way, we don't have to manually insert flushes in code paths that
may execute outside of a wl_display_dispatch_pending().

(Those that execute inside a wl_display_dispatch_pending() are subject
to the flush performed at the end of the normal wayland FDM handler).
</content>
</entry>
<entry>
<title>fdm: add hook priorities</title>
<updated>2020-01-04T22:26:27Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T22:26:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6534f64e6a1dfa21d8d99a195122035d741f7d65'/>
<id>urn:sha1:6534f64e6a1dfa21d8d99a195122035d741f7d65</id>
<content type='text'>
There are now three hook priorities: low, normal, high.

High priority hooks are executed *first*. Normal next, and last the
low priority hooks.

The renderer's terminal refresh hook now runs as a normal priority
hook.
</content>
</entry>
<entry>
<title>render: throttle xcursor updates</title>
<updated>2020-01-04T21:58:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T21:01:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5ec447697c7548fc7930031077e821fd1e26b2f9'/>
<id>urn:sha1:5ec447697c7548fc7930031077e821fd1e26b2f9</id>
<content type='text'>
With a bad behaving client (e.g. 'less' with mouse support enabled),
we can end up with a *lot* of xcursor updates (so much, that we
flooded the wayland socket before we implemented a blocking
wayl_flush()).

Since there's little point in updating the cursor more than once per
frame interval, use frame callbacks to throttle the updates.

This works more or lesslike normal terminal refreshes:

render_xcursor_set() stores the last terminal (window) that had (and
updated) the cursor.

The renderer's FDM hook checks if we have such a pending terminal set,
and if so, tries to refresh the cursor.

This is done by first checking if we're already waiting for a callback
from a previous cursor update, and if so we do nothing; the callback
will update the cursor for the next frame. If we're *not* already
waiting for a callback, we update the cursor immediately.
</content>
</entry>
<entry>
<title>wayland: wl_display_flush() never blocks</title>
<updated>2020-01-04T20:10:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T20:10:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=abc36d8f090dbae1b127f74a83b601d3fa3c8bed'/>
<id>urn:sha1:abc36d8f090dbae1b127f74a83b601d3fa3c8bed</id>
<content type='text'>
Since it doesn't block, we need to detect EAGAIN failures and ensure
we actually flush everything.

If we don't, we sooner or later end up in a wayland client library
call that aborts due to the socket buffer being full.

Ideally, we'd simply enable POLLOUT in the FDM. However, we cannot
write *anything* to the wayland socket until we've actually managed to
send everything. This means enabling POLLOUT in the FDM wont work
since we may (*will*) end up trying to write more data to it before
we've flushed it.

So, add a wrapper function, wayl_flush(), that acts as a blocking
variant of wl_display_flush(), by detecting EAGAIN failiures and
calling poll() itself, on the wayland socket only, until all data has
been sent.
</content>
</entry>
<entry>
<title>render: remove debug logging</title>
<updated>2020-01-04T20:09:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T20:09:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2128d5912f4c0b63fe92129dd4dec36dfc2ae910'/>
<id>urn:sha1:2128d5912f4c0b63fe92129dd4dec36dfc2ae910</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: attrs_to_font() is not used outside of render.c</title>
<updated>2020-01-04T18:53:55Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T18:53:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=647a299315a9d5a86fb0a767bcf18288246905b0'/>
<id>urn:sha1:647a299315a9d5a86fb0a767bcf18288246905b0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: trigger terminal refreshes in an FDM hook</title>
<updated>2020-01-04T18:49:26Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-01-04T18:49:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=99f471d738e0c2a0dcb61a559be3be512659d113'/>
<id>urn:sha1:99f471d738e0c2a0dcb61a559be3be512659d113</id>
<content type='text'>
In some cases, we end up calling render_refresh() multiple times in
the same FDM iteration. This means will render the first update
immediately, and then set the 'pending' flag, causing the updated
content to be rendered in the next frame.

This can cause flicker, or flashes, since we're presenting one or more
intermediate frames until the final content is shown.

Not to mention that it is inefficient to render multiple frames like
this.

Fix by:

* render_refresh() only sets a flag in the terminal

* install an FDM hook; this hook loops all terminals and executes what
  render_refresh() _used_ to do (that is, render immediately if we're
  not waiting for a frame callback, otherwise set 'pending' flag). for
  all terminals that have the 'refresh_needed' flag set.
</content>
</entry>
</feed>
