<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/terminal.c, branch 1.16.1</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.16.1</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.16.1'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2023-10-10T12:23:33Z</updated>
<entry>
<title>term: cache font baseline</title>
<updated>2023-10-10T12:23:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-10-10T12:23:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4449177517c2d96857483acbc8afd7438fcdfadd'/>
<id>urn:sha1:4449177517c2d96857483acbc8afd7438fcdfadd</id>
<content type='text'>
No need to redo the calculation for every single cell we render,
every frame...
</content>
</entry>
<entry>
<title>term_font_baseline(): only center glyph when a custom line-height is being used</title>
<updated>2023-10-10T11:52:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-10-10T11:52:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=34aa979f460c09a481a02af733737a5925c9b1bf'/>
<id>urn:sha1:34aa979f460c09a481a02af733737a5925c9b1bf</id>
<content type='text'>
When using the font's own line-height, simply set the baseline
'descent' pixels above the bottom of the cell.

This fixes an issue where some fonts appeared "glued" to the top of
the cell, and sometimes getting partially clipped.
</content>
</entry>
<entry>
<title>Revert "font baseline: use max(font-&gt;height, font-&gt;ascent + font-&gt;descent) when calculating font height"</title>
<updated>2023-10-10T08:52:35Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-10-10T08:52:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=41932287cf046a263ecaca0d8d140d4f57e180f1'/>
<id>urn:sha1:41932287cf046a263ecaca0d8d140d4f57e180f1</id>
<content type='text'>
This reverts commit fd813d0e6cfff57cf8a8f55e9a249ddb6fbdb6d6.

The intent of the reverted commit was to align font height calculation
with cell height calculation. However, it turns out this breaks some
fonts. Typically those with large:ish differences in their 'height'
attribute, and their ascent+descent value.

Closes #1511
</content>
</entry>
<entry>
<title>term: remove unneeded (and mostly unused) term-&gt;flash{,_alpha}</title>
<updated>2023-10-10T06:13:35Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-10-10T06:09:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=eea995637d2e65c206734a4d8084a9b500f77f05'/>
<id>urn:sha1:eea995637d2e65c206734a4d8084a9b500f77f05</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Enable the use of flash as visual bell</title>
<updated>2023-10-10T06:12:48Z</updated>
<author>
<name>Raimund Sacherer</name>
<email>rsachere@redhat.com</email>
</author>
<published>2023-10-07T17:37:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=827396237253d3c784c7455a9f3f2c26a8128c51'/>
<id>urn:sha1:827396237253d3c784c7455a9f3f2c26a8128c51</id>
<content type='text'>
With this patch we can configure flash in the bell section. The colors
section allow now to configure the color and translucency of the
flash.
</content>
</entry>
<entry>
<title>term_reset: log hard vs. soft reset</title>
<updated>2023-10-04T06:23:27Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-10-04T06:23:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=33a5a369f2054975cf31f6662f4dd82139df762a'/>
<id>urn:sha1:33a5a369f2054975cf31f6662f4dd82139df762a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Codespell fixes</title>
<updated>2023-10-03T12:11:55Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-10-03T12:11:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=58d967b2f31ebe1f16bd0915f28ec93919d3fddc'/>
<id>urn:sha1:58d967b2f31ebe1f16bd0915f28ec93919d3fddc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: get_font_dpi(): don't crash when there aren't any available monitors</title>
<updated>2023-10-01T07:20:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-10-01T07:20:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b95a7cb84f9bebdd99ac68d30fa8256cc60dc7ca'/>
<id>urn:sha1:b95a7cb84f9bebdd99ac68d30fa8256cc60dc7ca</id>
<content type='text'>
Seen on plasma; monitor is turned off, and then back on again. Before
the "new" output global is emitted, the compositor calls
fractional_scale::preferred_scale().

This results in a call to get_font_dpi(), where we crash, since it
assumes there is at least one monitor available.

Fix by falling back to a DPI of 96.

Hopefully closes #1498
</content>
</entry>
<entry>
<title>csi: implement DECSET/DECRST/DECRQM 2027 - grapheme cluster processing</title>
<updated>2023-09-25T14:50:44Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-09-20T11:45:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4eef001d5855b9b5afb59bbd3b92b3a2828fcca0'/>
<id>urn:sha1:4eef001d5855b9b5afb59bbd3b92b3a2828fcca0</id>
<content type='text'>
This implements private mode 2027 - grapheme cluster processing, as
defined in the "Terminal Unicode Core"[1] specification.

Internally, we just flip the already existing option "grapheme
shaping". Since it's now runtime changeable, we need a copy of it in
the terminal struct, rather than referencing the conf object.

[1]: https://github.com/contour-terminal/terminal-unicode-core/blob/13fc5a8993a033ff10c1f3433d08cb618cde4ac2/spec/terminal-unicode-core.tex#L50-L53
</content>
</entry>
<entry>
<title>term: improve fallback logic when selecting scaling factor while unmapped</title>
<updated>2023-08-18T14:48:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-08-18T14:39:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=86ef638102a6e03a5f46326162376c964ad353af'/>
<id>urn:sha1:86ef638102a6e03a5f46326162376c964ad353af</id>
<content type='text'>
The foot window may, for various reasons, become completely
unmapped (that is, being removed from all outputs) at run time.

One example is wlroots based compositors; they unmap all other windows
when an opaque window is fullscreened.

21d99f8dced335826964ca96b8ba7ccac059e598 introduced a regression,
where instead of picking the scaling factor from one of the available
outputs (at random), we started falling back to '1' as soon as we were
unmapped.

This patch restores the original logic, but also improves upon it.

As soon as a scaling factor has been assigned to the window, we store
a copy of it in the term struct ('scale_before_unmap').

When unmapped, we check if it has a valid value (the only time it
doesn't is before the initial map). If so, we use it.

Only if it hasn't been set do we fall back to picking an output at
random, and using its scaling factor.

Closes #1464
</content>
</entry>
<entry>
<title>wayland: cursor-shape-v1 is now always available</title>
<updated>2023-08-07T14:53:19Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-31T14:33:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=698c5b54f32c885304d5e2ff55580ce7f52b5da7'/>
<id>urn:sha1:698c5b54f32c885304d5e2ff55580ce7f52b5da7</id>
<content type='text'>
Since we're requiring wayland-protocols &gt;= 1.32
</content>
</entry>
<entry>
<title>wayland: fractional-scale-v1 is now always available</title>
<updated>2023-08-07T14:53:19Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-31T14:32:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7eee415b7573f5a20852c6e29001945149e920a2'/>
<id>urn:sha1:7eee415b7573f5a20852c6e29001945149e920a2</id>
<content type='text'>
Since we're requiring wayland-protocols &gt;= 1.32
</content>
</entry>
<entry>
<title>font baseline: use max(font-&gt;height, font-&gt;ascent + font-&gt;descent) when calculating font height</title>
<updated>2023-07-28T13:36:48Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-28T13:36:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fd813d0e6cfff57cf8a8f55e9a249ddb6fbdb6d6'/>
<id>urn:sha1:fd813d0e6cfff57cf8a8f55e9a249ddb6fbdb6d6</id>
<content type='text'>
This is how it's done when calculating the cell height, and we should
do the same thing when calculating the font baseline.
</content>
</entry>
<entry>
<title>scaling: always round the scaling factor when converting to int</title>
<updated>2023-07-25T14:48:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-25T13:56:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=613c61abb44e49236a893376764eb21702c0ef32'/>
<id>urn:sha1:613c61abb44e49236a893376764eb21702c0ef32</id>
<content type='text'>
* In all calls to wl_subsurface_set_position()
* (wp_viewport_set_destination() already does this)
* Whenever we use the scale to calculate margins (search box,
  scrollback indicator etc)
* Since the scaling factor is stored as a float (and not a double),
  use roundf() instead of round()
</content>
</entry>
<entry>
<title>render: apply new baseline calculation everywhere</title>
<updated>2023-07-25T13:53:29Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-23T15:35:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a36f67cbe311bebd9321fbf58773dace8128fcd7'/>
<id>urn:sha1:a36f67cbe311bebd9321fbf58773dace8128fcd7</id>
<content type='text'>
* URL jump labels
* Scrollback position indicator
* Line/box drawings characters

Closes #1430
</content>
</entry>
<entry>
<title>term: destroy: unref key bindings *after* destroying window</title>
<updated>2023-07-18T16:26:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-18T14:13:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fdd753263b3ebe96a83c73fbf560773dce04efd0'/>
<id>urn:sha1:fdd753263b3ebe96a83c73fbf560773dce04efd0</id>
<content type='text'>
This fixes a crash-on-exit on compositors that emit a _"keyboard
leave"_ event when a surface is unmapped.

In our case, destroying the window (where we unmap it) in
term_destroy(), lead to a crash in term_mouse_grabbed(), due to
key_binding_for() returning NULL.

The call chain in this is case is, roughly:

  term_destroy() -&gt;
  wayl_win_destroy() -&gt;
  keyboard_leave() -&gt;
  term_xcursor_update_for_seat() -&gt;
  term_mouse_grabbed()
</content>
</entry>
<entry>
<title>term: get_font_subpixel(): use subpixel from monitor we were *last* mapped on</title>
<updated>2023-07-18T03:48:02Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-17T14:28:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7fca81dd3fd3cfd5ee6caafacfb61fd19adb0dcb'/>
<id>urn:sha1:7fca81dd3fd3cfd5ee6caafacfb61fd19adb0dcb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>terminal: break out scaling factor updating, and reduce number of calls to render_resize()</title>
<updated>2023-07-18T03:48:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-17T14:21:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=21d99f8dced335826964ca96b8ba7ccac059e598'/>
<id>urn:sha1:21d99f8dced335826964ca96b8ba7ccac059e598</id>
<content type='text'>
Break out the logic that updates the terminal’s scaling factor value,
from render_resize(), to a new function, term_update_scale(). This
allows us to update the scaling factor without a full grid resize.

We also change how we pick the scaling factor (when fractional scaling
is not in use). Before, we’d use the highest scaling factor from all
monitors we were mapped on. Now, we use the scaling factor from the
monitor we were *last* mapped on.

Then, add a boolean parameter to term_set_fonts(), and when
false, *don’t* call render_resize_force().

Also change term_font_dpi_changed() to only return true if the font
was changed in any way.

Finally, rewrite update_term_for_output_change() to:

* Call term_update_scale() before doing anything else
* Call render_resize{,_force} *last*, and *only* if either the scale
  or the fonts were updated.

This fixes several things:

* A bug where we failed to update the fonts when fractional scaling
  was in use, and we guessed the initial scale/DPI wrong. The bug
  happened because updated the internal "preferred" scale value, and a
  later call to render_resize() updated the terminal’s scale value,
  but since that code path didn’t call term_font_dpi_changed() (and it
  shouldn’t), the fonts weren’t resized properly.

* It ensures we only resize the grid *once* when the scaling factor,
  or DPI is changed. Before this, we’d resize it twice. And this
  happened when e.g. dragging the window between monitors.
</content>
</entry>
<entry>
<title>wayland: use physical DPI on fractional-scale capable compositors</title>
<updated>2023-07-18T03:48:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-17T14:19:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b2a29280cbd3fcd825123e7636d511a06b2df242'/>
<id>urn:sha1:b2a29280cbd3fcd825123e7636d511a06b2df242</id>
<content type='text'>
With legacy scaling, we need to use a "scaled", or "logical" DPI
value, that is basically the real DPI value scaled by the monitor’s
scaling factor.

This is necessary to compensate for the compositor downscaling the
surface, for "fake" fractional scaling.

But with true fractional scaling, *we* scale the surface to the final
size. This means we should *not* use the scaled DPI, but the monitor’s
actual DPI.

To facilitate this, store both the scaled and the unscaled DPI value
in the monitor struct.

This patch also changes how we pick the DPI value. Before, we would
use the highest DPI value from all the monitors we were mapped
on. Now, we use the DPI value from the monitor we were *last* mapped
on (typically the window we’re dragging the window *to*).
</content>
</entry>
<entry>
<title>term: font_dpi_changed: scale (and old_scale) are floating point</title>
<updated>2023-07-18T03:48:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-16T06:28:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=829353a5dad410ce9b6b1ca78f9d86beedc3a90e'/>
<id>urn:sha1:829353a5dad410ce9b6b1ca78f9d86beedc3a90e</id>
<content type='text'>
This should fix an issue where the font size wasn’t updated when
moving the window between outputs whose scaling factors match when
truncated.
</content>
</entry>
</feed>
