<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/terminal.c, branch 1.9.2</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.9.2</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.9.2'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2021-09-24T20:07:47Z</updated>
<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>term: turn ‘box-drawings’ array into three dynamically allocated arrays</title>
<updated>2021-09-14T07:50:49Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-09-14T07:50:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=37b15adcd8306652ce21804cb6140d1361adc94f'/>
<id>urn:sha1:37b15adcd8306652ce21804cb6140d1361adc94f</id>
<content type='text'>
The box_drawings array is now quite large, and uses up ~4K
when *empty*.

This patch splits it up into three separate, dynamically allocated
arrays; one for the traditional box+line drawing and block elements
glyphs, one for braille, and one for the legacy computing symbols.

When we need to render a glyph, the *entire* array (that it belongs
to) is allocated.

I.e this is one step closer to a dynamic glyph cache (like the one
fcft uses), but doesn’t go all the way.

This is especially nice for people with
‘box-drawings-uses-font-glyphs=yes’; for them, the custom glyphs now
uses 3*8 bytes (for the three array pointers), instead of 4K.
</content>
</entry>
<entry>
<title>term: reduce scope of variable</title>
<updated>2021-09-05T10:39:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-09-05T10:39:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d1266625608f8f593f4df76c1b6ff1897c89adc9'/>
<id>urn:sha1:d1266625608f8f593f4df76c1b6ff1897c89adc9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>terminal: prefer the advance width of ‘M’ over that of a space</title>
<updated>2021-08-31T17:56:59Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-31T17:56:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bb948d03e199870da6b35ba6f88ea88be12cfe21'/>
<id>urn:sha1:bb948d03e199870da6b35ba6f88ea88be12cfe21</id>
<content type='text'>
This makes some non-monospaced fonts more readable, allowing users to
read errors and warnings printed in the window.

Furthermore, fcft-3.0 will remove the space_advance member, so once we
upgrade, we’ll have to rasterize a glyph ourselves anyway.
</content>
</entry>
<entry>
<title>term: check visual-focus, not kbd-focus when enabling/disabling cursor blink</title>
<updated>2021-08-17T16:31:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-17T16:31:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b4402a6aa5228d8428ab7129bdfc07f94ed5bc03'/>
<id>urn:sha1:b4402a6aa5228d8428ab7129bdfc07f94ed5bc03</id>
<content type='text'>
term_cursor_blink_update() is called when the visual focus changes
state (i.e. when our top-level surface is activated de-activated).

Checking keyboard focus worked on Sway, but on e.g. GNOME, the order
in which keyboard focus and visual focus are updated is different, and
we ended up either making the cursor invisible, or visible, but not
blinking, when changing focus back to the window.

Closes #686
</content>
</entry>
<entry>
<title>pt-or-px: heed the dpi-aware setting</title>
<updated>2021-08-13T15:38:56Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-13T15:38:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f6f8f2b35ec10eb09f2c7c5b8214b62fa87b59e5'/>
<id>urn:sha1:f6f8f2b35ec10eb09f2c7c5b8214b62fa87b59e5</id>
<content type='text'>
Before this patch, pt-or-px values, like letter-spacing, were *always*
scaled using the current DPI value.

This is wrong; if the fonts are scaled using the output’s scaling
factor, then so should all other point values.

This also fixes an issue where e.g. letter-spacing would use one DPI
value at startup, but then when increasing/decreasing or resetting the
font size, would be re-calculated using a different DPI value, leading
to completely different spacing.

This happened when there were multiple monitors, with different DPI
values, and foot guessed the initial DPI value wrong. Normally, foot
would correct itself as soon as the window was mapped, and the
“correct” DPI value known. But if the fonts were scaled using the
scaling factor, it was possible that the font reload never happened.

This patch also updates the thickness calculation (for LIGHT and HEAVY
box drawing characters) to use the scaling factor when appropriate.

Closes #680
</content>
</entry>
<entry>
<title>input: implement support for mouse wheel left/right</title>
<updated>2021-08-07T10:27:44Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-05T16:34:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c2cc964116f9fc6c6432c5c00b113c92bdfcdcd6'/>
<id>urn:sha1:c2cc964116f9fc6c6432c5c00b113c92bdfcdcd6</id>
<content type='text'>
We now emit button 6/7 events (when the client application grabs the
mouse). This buttons map to mouse wheel horizontal scroll events. Or, left/right
tilting, if you like.

Wayland report these as ‘axis’ events (just like regular scroll wheel events),
and thus we need to translate those scroll events to button events.

libinput does not define any mouse buttons for wheel tilts, so we add our own
defitions. These are added last in the BTN_* range, just before the BTN_JOYSTICK
events.
</content>
</entry>
<entry>
<title>term: disable debug logging</title>
<updated>2021-08-05T16:24:52Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-05T16:24:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bdaa9a8991d535ff02459eb3cc71c37adc45e9d1'/>
<id>urn:sha1:bdaa9a8991d535ff02459eb3cc71c37adc45e9d1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: send SIGTERM/SIGKILL to the entire process group</title>
<updated>2021-07-31T20:50:19Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-31T20:50:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f1d440e139d675b199d4e4c1ef4032e8b6da1a39'/>
<id>urn:sha1:f1d440e139d675b199d4e4c1ef4032e8b6da1a39</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: fix release builds when LOG_ENABLE_DBG=0</title>
<updated>2021-07-31T17:52:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-31T17:52:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b7edfc2822368f4599cd41caba9a270c501c39d7'/>
<id>urn:sha1:b7edfc2822368f4599cd41caba9a270c501c39d7</id>
<content type='text'>
</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: rename: slave_died() -&gt; fdm_client_terminated()</title>
<updated>2021-07-31T16:27:02Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-31T16:27:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c23bff418961e120cef919fec39ac5e5b3a1ffa0'/>
<id>urn:sha1:c23bff418961e120cef919fec39ac5e5b3a1ffa0</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>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>term: erase_scrollback(): destroy sixels that touch the scrollback</title>
<updated>2021-07-18T14:31:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-18T14:31:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e8e9cd559529b91968af9f776df8b87751df7b97'/>
<id>urn:sha1:e8e9cd559529b91968af9f776df8b87751df7b97</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: add unit test for term_erase_scrollback()</title>
<updated>2021-07-18T14:14:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-18T13:34:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d0a7f999c662759d1704d97d5217736e84f508c1'/>
<id>urn:sha1:d0a7f999c662759d1704d97d5217736e84f508c1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>csi: erase scrollback: cancel selection if it touches the scrollback</title>
<updated>2021-07-18T14:14:21Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-16T14:45:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5f0ceb72f176caf7673ea1d4bc5195f26f4b4df7'/>
<id>urn:sha1:5f0ceb72f176caf7673ea1d4bc5195f26f4b4df7</id>
<content type='text'>
This breaks out the scrollback erasing logic for \E[3J from csi.c, and
moves it to the new function term_erase_scrollback(), and changes the
logic to calculate the start and end row (absolute) numbers of the
scrollback, and only iterate those, instead of iterating *all* rows,
filtering out those that are on-screen.

It also adds an intersection range check of the selection range, and
cancels the selection if it touches any of the deleted scrollback
rows.

This fixes a crash when trying to render the next frame, since the
selection now references rows that have been freed.

Closes #633
</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>shm: replace 'locked' attribute with a ref-counter</title>
<updated>2021-07-17T17:14:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-16T14:47:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=232fb20269b68157874f57d676c1b0b95c2386aa'/>
<id>urn:sha1:232fb20269b68157874f57d676c1b0b95c2386aa</id>
<content type='text'>
The initial ref-count is either 1 or 0, depending on whether the
buffer is supposed to be released "immeidately" (meaning, as soon as
the compositor releases it).

Two new user facing functions have been added: shm_addref() and
shm_unref().

Our renderer now uses these two functions instead of manually setting
and clearing the 'locked' attribute.

shm_unref() will decrement the ref-counter, and destroy the buffer
when the counter reaches zero. Except if the buffer is currently
"busy" (compositor owned), in which case destruction is deferred to
the release event. The buffer is still removed from the list though.
</content>
</entry>
<entry>
<title>config: add locked-title=no|yes</title>
<updated>2021-07-04T15:59:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-04T15:59:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fcb60abc132b12ccf8fb8ff215acc924a44773d6'/>
<id>urn:sha1:fcb60abc132b12ccf8fb8ff215acc924a44773d6</id>
<content type='text'>
Closes #386
</content>
</entry>
</feed>
