<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/render.c, branch 1.15.1</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.15.1</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.15.1'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2023-07-21T06:17:32Z</updated>
<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>
<entry>
<title>refactor: track current xcursor using an enum, instead of a char pointer</title>
<updated>2023-07-03T12:36:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-27T14:57:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ee794a121e4603d01fb662ad6d1f3b18b6937d2c'/>
<id>urn:sha1:ee794a121e4603d01fb662ad6d1f3b18b6937d2c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>sixel: re-scale images when the cell dimensions change</title>
<updated>2023-06-30T06:29:35Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-29T12:49:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=49fb0cf359bb2486bbdf58df62c66c890d7e31cd'/>
<id>urn:sha1:49fb0cf359bb2486bbdf58df62c66c890d7e31cd</id>
<content type='text'>
Before this patch, when the cell dimensions changed (i.e. when the
font size changes), sixel images were either removed (the new cell
dimensions are smaller than the old), or simply kept at their original
size (new cell dimensions are larger).

With this patch, sixels are instead resized. This means a
sixel *always* occupies the same number of rows and columns,
regardless of how much the font size is changed.

This is done by maintaining two sets of image data and pixman images,
as well as their dimensions. These two sets are the new ‘original’ and
‘scaled’ members of the sixel struct.

The "top-level" pixman image pointer, and the ‘width’ and ‘height’
members either point to the "original", or the "scaled" version.

They are invalidated as soon as the cell dimensions change. They, and
the ‘scaled’ image is updated on-demand (when we need to render a
sixel).

Note that the ‘scaled’ image is always NULL when the current cell
dimensions matches the ones used when emitting the sixel (to save
run-time memory).

Closes #1383
</content>
</entry>
<entry>
<title>wayland: refactor: surface_scale(): pass wl_window pointer, instead of wayland global</title>
<updated>2023-06-29T13:38:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-26T19:06:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d71e588800fea0f7b7815cc5ce51ded752070b95'/>
<id>urn:sha1:d71e588800fea0f7b7815cc5ce51ded752070b95</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: refactor: add a buffer argument to wayl_*_scale() functions</title>
<updated>2023-06-29T13:38:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-26T15:05:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5a60bbc119397c2993fc1895bae75c2c1e69fe1d'/>
<id>urn:sha1:5a60bbc119397c2993fc1895bae75c2c1e69fe1d</id>
<content type='text'>
This will be needed later, when using fractional scaling + viewporter
to scale.
</content>
</entry>
<entry>
<title>wayland: refactor: wayl_surface_scale(): pass wayl_surface pointer</title>
<updated>2023-06-29T13:38:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-26T14:53:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=434fd6aa1f4a21ef6572a772ec891eeb2006a82c'/>
<id>urn:sha1:434fd6aa1f4a21ef6572a772ec891eeb2006a82c</id>
<content type='text'>
Instead of passing a raw wl_surface pointer, pass a wayl_surface
pointer.

This is needed later, when using fractional scaling to scale the
surface (since then we need the surface’s viewport object).
</content>
</entry>
<entry>
<title>wayland: refactor: wrap wl_surface pointers in a wayl_surface struct</title>
<updated>2023-06-29T13:38:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-26T14:10:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ba46a039aca734bb284c22ba5d5bddf5407e3848'/>
<id>urn:sha1:ba46a039aca734bb284c22ba5d5bddf5407e3848</id>
<content type='text'>
And add a viewport object to accompany the surface (to be used when
scaling the surface).

Also rename the wl_surf_subsurf struct to wayl_sub_surface, and add a
wayl_surface object to it, rather than a plain wl_surface pointer (to
also get the viewport pointer).
</content>
</entry>
<entry>
<title>wayland: add wayl_surface_scale(), and wayl_win_scale()</title>
<updated>2023-06-29T13:38:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-26T13:51:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0a5073f5703e89cfa4219d5b532cb134f9def6d5'/>
<id>urn:sha1:0a5073f5703e89cfa4219d5b532cb134f9def6d5</id>
<content type='text'>
These functions scale a surface+buffer.

For now, only using the legacy scaling
method (wl_surface_set_buffer_scale()).
</content>
</entry>
<entry>
<title>render: maybe_resize(): convert local variable ‘scale’ to float</title>
<updated>2023-06-29T13:38:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-06-22T13:01:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4bd62b10058c626cecb5eb15c9c44aee58bf547a'/>
<id>urn:sha1:4bd62b10058c626cecb5eb15c9c44aee58bf547a</id>
<content type='text'>
</content>
</entry>
</feed>
