<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/render.c, branch releases/1.15</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=releases%2F1.15</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=releases%2F1.15'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2023-08-07T14:38:03Z</updated>
<entry>
<title>render: OSD: center text vertically</title>
<updated>2023-08-07T14:38:03Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-31T14:29:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a3d54614c7bc0a88b00bb98ad7bb2f730b0b7e72'/>
<id>urn:sha1:a3d54614c7bc0a88b00bb98ad7bb2f730b0b7e72</id>
<content type='text'>
Rewrite render_osd(), and instead of passing in an y-offset, let
render_osd() itself center the text inside the OSD buffer.

This is done using the same baseline calculation term_font_baseline()
does, except we use the buffer height instead of the line height.

Note that most OSDs are sized based on the line height...

Closes #1430
</content>
</entry>
<entry>
<title>--window-size-chars: ensure width/height are valid for current scaling factor</title>
<updated>2023-07-30T05:53:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-30T05:53:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1af0277564f6347caa85fda4b46071c0cf03234c'/>
<id>urn:sha1:1af0277564f6347caa85fda4b46071c0cf03234c</id>
<content type='text'>
Before this patch, we didn’t ensure width and height were valid for
the current scaling factor, when fractional scaling _is_
available. That is, we didn’t ensure the width/height values
multiplied back to their original values after dividing with the
scaling factor.

Closes #1446
</content>
</entry>
<entry>
<title>fractional scaling: another round(!) of rounding fixes</title>
<updated>2023-07-28T14:03:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-28T13:28:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=17824744812c16560dd214b98f28977b0d2fb47d'/>
<id>urn:sha1:17824744812c16560dd214b98f28977b0d2fb47d</id>
<content type='text'>
* Ensure buffer sizes are valid. That is, ensure that
  size / scale * scale == size.
* Do size calculation of the window geometry in the same way we
  calculate the CSD offsets.
</content>
</entry>
<entry>
<title>render: round scaled border/title/button widths</title>
<updated>2023-07-28T14:03:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-27T18:07:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=753c4b5d4fb51574524af06ba56333f4241b1a9b'/>
<id>urn:sha1:753c4b5d4fb51574524af06ba56333f4241b1a9b</id>
<content type='text'>
And calculation of compounded offsets/widths/heights, to compensate
for compositor rounding when positioning and scaling/sizing
subsurfaces.

Closes #1441
</content>
</entry>
<entry>
<title>config: add tweak.bold-text-in-bright-amount</title>
<updated>2023-07-28T13:40:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-26T14:12:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f3c5b82c8276feda3c9eec522e549062c1589484'/>
<id>urn:sha1:f3c5b82c8276feda3c9eec522e549062c1589484</id>
<content type='text'>
By how much to increase the luminance when brightening bold
fonts. This was previously hard-coded to a factor of 1.3, which is now
the default value of the new config option.

Closes #1434
</content>
</entry>
<entry>
<title>render: revert part of a36f67cbe311bebd9321fbf58773dace8128fcd7</title>
<updated>2023-07-28T13:37:48Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-28T13:37:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e912656682cd6645241fd5ba9ce3c1d1533c03b4'/>
<id>urn:sha1:e912656682cd6645241fd5ba9ce3c1d1533c03b4</id>
<content type='text'>
render_osd() shouldn't use term_font_baseline().

This is because term_font_baseline() uses the line height to determine
the position, while render_osd() renders to surfaces that aren't sized
like the grid.

This fixes a regression, where the CSD title were sometimes rendered
too high up, and sometimes too low.
</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>render: change baseline calculation, to center it within the line</title>
<updated>2023-07-21T06:17:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-21T06:17:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b3255465f1d4d5a96fbd7acee846db0e14026507'/>
<id>urn:sha1:b3255465f1d4d5a96fbd7acee846db0e14026507</id>
<content type='text'>
Before this patch, fonts were anchored to the top of the line. With
this patch, it is instead centered.

Closes #1302
</content>
</entry>
<entry>
<title>render: OSD: don’t mark surface as being opaque, when it’s not</title>
<updated>2023-07-19T14:43:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-19T14:39:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a49281ced3fb27d6fa0f59f7964c5c0cc07b3829'/>
<id>urn:sha1:a49281ced3fb27d6fa0f59f7964c5c0cc07b3829</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: disable transparency when we’re fullscreened</title>
<updated>2023-07-19T14:42:41Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-19T14:34:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=899b768b744c74e88e54e6d8eb32f53accea79d8'/>
<id>urn:sha1:899b768b744c74e88e54e6d8eb32f53accea79d8</id>
<content type='text'>
The wayland protocol recommends (or mandates?) that compositors render
a black background behind fullscreened transparent windows. I.e. you
never see what’s _actually_ behind the window.

So, if you have a white, but semi-transparent background in foot,
it’ll be rendered in a shade of gray.

Given this, it’s better to simply disable transparency while we’re
fullscreened. That way, we at least get the "correct" background
color.

Closes #1416
</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>render: fix xcursor scaling with fractional-scale-v1</title>
<updated>2023-07-18T03:44:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-17T18:08:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6de69aa9b726c2e270455ac44a7b8d5177b7332e'/>
<id>urn:sha1:6de69aa9b726c2e270455ac44a7b8d5177b7332e</id>
<content type='text'>
This worked just after the fractional-scaling branch was merged, but
was then broken by the cursor-shape branch, due to a bad rebase of
that branch.
</content>
</entry>
<entry>
<title>render: use rounding for fractional scale</title>
<updated>2023-07-16T03:03:16Z</updated>
<author>
<name>Ronan Pigott</name>
<email>ronan@rjp.ie</email>
</author>
<published>2023-07-14T23:53:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b7100d57160d2ae7a38d5517f1c2cd7155737d88'/>
<id>urn:sha1:b7100d57160d2ae7a38d5517f1c2cd7155737d88</id>
<content type='text'>
If we truncate the buffer dimensions we may accidentally submit a
buffer with inappropriate size.
</content>
</entry>
<entry>
<title>render: don’t invert cursor colors when custom colors are being used</title>
<updated>2023-07-14T07:57:10Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-14T07:51:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b3745b31c72042adf523b54be7c2a297a82cca7f'/>
<id>urn:sha1:b3745b31c72042adf523b54be7c2a297a82cca7f</id>
<content type='text'>
When the user has configured custom cursor colors (cursor.color is set
in foot.ini), don’t invert those colors when the cell is either
selected, or has the ‘reverse’ attribute set.

This aligns foot’s behavior with Alacritty, Kitty and Wezterm. Contour
also behaves similarly, except mouse selections override the cursor
colors (turning the cursor invisible).

Closes #1347
</content>
</entry>
<entry>
<title>render: move variables inside #ifdef, as they’re not used outside of it</title>
<updated>2023-07-03T12:36:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-29T14:07:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6388954e8f908a8cfd2f170c6a4f2c05370de762'/>
<id>urn:sha1:6388954e8f908a8cfd2f170c6a4f2c05370de762</id>
<content type='text'>
</content>
</entry>
<entry>
<title>cursor-shape: use server-side cursors for custom (OSC-22), if possible</title>
<updated>2023-07-03T12:36:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-28T11:25:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c2baaff3c1311335b46e75db27bfd79d4f7b623b'/>
<id>urn:sha1:c2baaff3c1311335b46e75db27bfd79d4f7b623b</id>
<content type='text'>
Using a lookup table, try to map the user-provided xcursor string to a
cursor-shape-v1 known shape.

If we succeed, set the user’s custom cursor using server side
cursors (i.e. using cursor-shape-v1).

If not, fallback to trying to load the image ourselves (using
wl_cursor_theme_get_cursor()), and set it using the legacy
wl_pointer_set_cursor().
</content>
</entry>
<entry>
<title>render: don’t (can’t) use cursor-shape-v1 when user has set a custom cursor</title>
<updated>2023-07-03T12:36:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-27T16:40:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ddd6004b275dd9a24f26e03dead90f0fffb0cc3e'/>
<id>urn:sha1:ddd6004b275dd9a24f26e03dead90f0fffb0cc3e</id>
<content type='text'>
Well, we _could_, but we’d have to reverse map the string to a
cursor-shape-v1 enum value. Let’s not do that, for now at least.
</content>
</entry>
<entry>
<title>render: debug log which method we use to set the xcursor</title>
<updated>2023-07-03T12:36:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-27T15:42:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6ed5dce5ab5651c1ee345d0315c1538900282f59'/>
<id>urn:sha1:6ed5dce5ab5651c1ee345d0315c1538900282f59</id>
<content type='text'>
</content>
</entry>
<entry>
<title>cursor-shape: add support for server side cursor shapes</title>
<updated>2023-07-03T12:36:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-27T15:25:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c8e13ad3938d68635693d0b0f4bf1054628e8387'/>
<id>urn:sha1:c8e13ad3938d68635693d0b0f4bf1054628e8387</id>
<content type='text'>
This implements support for the new cursor-shape-v1 protocol. When
available, we use it, instead of client-side cursor surfaces, to
select the xcursor shape.

Note that we still need to keep client side pointers, for:

* backward compatibility
* to be able to "hide" the cursor

Closes #1379
</content>
</entry>
</feed>
