<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/render.c, branch releases/1.18</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=releases%2F1.18</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=releases%2F1.18'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2024-08-09T06:20:59Z</updated>
<entry>
<title>csd: track pointer when rendering and handling CSD button clicks</title>
<updated>2024-08-09T06:20:59Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-08-09T06:20:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bef613e656a36400577cde295b09267c80f3adce'/>
<id>urn:sha1:bef613e656a36400577cde295b09267c80f3adce</id>
<content type='text'>
* Render button as highlighted only when pointer is above them
* Releasing the mouse button while *not* on the button does *not*
  activate the button

When pressing, and holding, a mouse button, the compositor keeps
sending motion events for the surface where the button was pressed,
even if the mouse has moved outside it.

We also don't get any surface leave/enter events.

This meant that the button was rendered as highlighted, and a click
registered, if the user pressed the mouse button while on the button,
and then moved the cursor away from the button before releasing the
button.

This patch fixes it, by checking if the current cursor coordinates
fall within the button surface.
</content>
</entry>
<entry>
<title>Remove a number of unused includes</title>
<updated>2024-08-02T06:28:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-08-01T18:11:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a9e462d952ca1e0367e9e6eb6ee00a0cda7e8c9b'/>
<id>urn:sha1:a9e462d952ca1e0367e9e6eb6ee00a0cda7e8c9b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>csi: in-band window resize notifications, private mode 2048</title>
<updated>2024-07-19T04:54:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-06-30T17:44:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=38461eef6f3b612277bf48e49b9cc6c3b79e25bb'/>
<id>urn:sha1:38461eef6f3b612277bf48e49b9cc6c3b79e25bb</id>
<content type='text'>
This implements
https://gist.github.com/rockorager/e695fb2924d36b2bcf1fff4a3704bd83,
in-band window resize notifications.

When user enables private mode 2048 (in-band resize
notifications), *always* send current size, even if the mode is
already active.

This ensures applications can rely on getting a reply from the
terminal.
</content>
</entry>
<entry>
<title>render: hollow-cursor: use correct cursor color</title>
<updated>2024-07-13T08:37:21Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-13T08:22:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=56556e5f237025619820a3c8595e0de9d2b1c230'/>
<id>urn:sha1:56556e5f237025619820a3c8595e0de9d2b1c230</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: cursor: use default fg/bg if cell fg/bg are the same</title>
<updated>2024-07-13T08:30:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-13T08:19:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c46c124363fad6dabd8328bdf8e15e5da8fabf7e'/>
<id>urn:sha1:c46c124363fad6dabd8328bdf8e15e5da8fabf7e</id>
<content type='text'>
When deciding which colors to use for the cursor, and the cursor text
and background colors are the same, use the default fg/bg instead.

Closes #1761
</content>
</entry>
<entry>
<title>osc: merge OSC 10/11/12/17/19 handling</title>
<updated>2024-07-03T07:47:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-01T15:24:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5d4a002413cdf09aa471e29b0a7ae29f7cf7b89c'/>
<id>urn:sha1:5d4a002413cdf09aa471e29b0a7ae29f7cf7b89c</id>
<content type='text'>
10/11/17/19 were already merged, so this patch just stops special
casing 12 (cursor color).

In preparation for XTPUSHCOLORS/XTPOPCOLORS, the cursor colors are
moved from their own struct, into the 'colors' struct.

Also fix a bug where OSC 17/19 queries returned OSC-11 data.
</content>
</entry>
<entry>
<title>render: fix "maybe-uninitialized" error in draw_styled_underline()</title>
<updated>2024-07-03T05:55:01Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2024-07-03T05:55:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=970b95509c0ddb8dcf3733f3f27eb78da792a296'/>
<id>urn:sha1:970b95509c0ddb8dcf3733f3f27eb78da792a296</id>
<content type='text'>
Reproducer:

    CFLAGS='-Og -g' meson setup --buildtype=debug bld
    ninja -C bld

Error message:

    ../render.c: In function ‘draw_styled_underline’:
    ../render.c:490:19: error: ‘y_ofs’ may be used uninitialized
    [-Werror=maybe-uninitialized]
      490 |         const int top = y + y_ofs;
          |                   ^~~
    ../render.c:405:9: note: ‘y_ofs’ was declared here
      405 |     int y_ofs;
          |         ^~~~~
</content>
</entry>
<entry>
<title>Rename various uses of "curly" in the source code with "underline"</title>
<updated>2024-07-01T19:00:16Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2024-07-01T19:00:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=674a535fc3e1260762aaecb37af4a32581d9b0c6'/>
<id>urn:sha1:674a535fc3e1260762aaecb37af4a32581d9b0c6</id>
<content type='text'>
Since "curly" could make it seem as if all underline styles are curled
(to people unfamiliar with the codebase), whereas in reality only 1 is.
</content>
</entry>
<entry>
<title>render: cursor color: remove assertion that both cursor fg/bg be set</title>
<updated>2024-07-01T08:53:21Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-01T08:53:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7341ba5ee35e95c36fa90fcab912774615f7f2e1'/>
<id>urn:sha1:7341ba5ee35e95c36fa90fcab912774615f7f2e1</id>
<content type='text'>
Before this patch, we asserted both the cursor foreground, and
background colors had been set. This is true in most cases; the config
system enforces it.

It is however possible to set only the cursor background color, while
leaving the foreground (text) color unset:

* Use a foot config that does *not* configure the cursor colors. This
  means foot will invert the default fg/bg colors when rendering the
  cursor.
* Override the cursor color using an OSC-12 sequence. OSC-12 only sets
  the background color of the cursor, and there is no other OSC sequence
  to set the cursor's text color.

To handle this, remove the assertion, and simply split the logic for
the cursor backgound and foreground colors:

* Use the configured background color if set (either through config or
  OSC-12), otherwise use the default foreground color.
* Use the configured foreground color if set (through config),
  otherwise use the default background color.
</content>
</entry>
<entry>
<title>render: draw_styled_underline(): respect main.underline-thickness</title>
<updated>2024-06-27T17:21:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-06-27T16:54:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0c7725217a706f6df1b543c4c85f54872aaf2f21'/>
<id>urn:sha1:0c7725217a706f6df1b543c4c85f54872aaf2f21</id>
<content type='text'>
Also refactor a bit, and break out early to draw_underline() for
legacy underlines.
</content>
</entry>
<entry>
<title>render: underlines: improve the appearance of the 'dotted' style</title>
<updated>2024-06-27T16:36:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-06-27T16:36:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=19bf558e6cee456eabe6b87d9d51e8f220e20cfa'/>
<id>urn:sha1:19bf558e6cee456eabe6b87d9d51e8f220e20cfa</id>
<content type='text'>
Try to make the 'dotted' style appear more even, and less like each
cell is rendered separately (even though they are).

Algorithm:

Each dot is a square; it's sides are that of the font's line
thickness.

The spacing (gaps) between the dots is initially the same width as the
dots themselves.

This means the number of dots per cell is the cell width divided by
the dots' length/width, divided by two.

At this point, there may be "left-over" pixels.I.e. the widths of the
dots and the gaps between them may not add up to the width of the
cell.

These pixels are evenly (as possible) across the gaps.

There are still visual inaccuracies at small font sizes. This is
impossible to fix without changing the way underlines are rendered, to
render an entire line in one go. This is not something we want to do,
since it'll make styled underlines, for a specific cell/character,
look differently, depending on the surrounding context.
</content>
</entry>
<entry>
<title>render: underlines: minor perf-tweak: early break out</title>
<updated>2024-06-26T16:39:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-06-23T23:50:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=08138e9546a00736d6dab6197070f5455d4d7f8c'/>
<id>urn:sha1:08138e9546a00736d6dab6197070f5455d4d7f8c</id>
<content type='text'>
When looking up the extender underline range, break out early if we
see that there can't possibly be any ranges matching the current column.
</content>
</entry>
<entry>
<title>render: resize: copy styled underlines to temporary grid</title>
<updated>2024-06-26T16:39:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-06-23T22:57:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=963ce45f3f29bccf7ca5aa0dc8e258a11cfbc552'/>
<id>urn:sha1:963ce45f3f29bccf7ca5aa0dc8e258a11cfbc552</id>
<content type='text'>
When doing an interactive resize, we create a small grid copy of the
current viewport, and then do a non-reflow resize.

When the interactive resize is done, we do a proper reflow. This is
for performance reasons.

When creating the viewport copy, we also need to copy the styled
underlines. Otherwise, styled underlines will be rendered as plain
underlines *while resizing*.
</content>
</entry>
<entry>
<title>render: styled underlines</title>
<updated>2024-06-26T16:39:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-06-23T16:55:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8e2402605ec81358cd18c657c9698044598b72f0'/>
<id>urn:sha1:8e2402605ec81358cd18c657c9698044598b72f0</id>
<content type='text'>
This was originally contributed by @kraftwerk28 in
https://codeberg.org/dnkl/foot/pulls/1099

Here, we re-use the rendering logic only, as attribute tracking has
been completely rewritten.
</content>
</entry>
<entry>
<title>csi: wip: styled underlines</title>
<updated>2024-06-26T16:39:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-06-23T15:39:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=32effc6657c1802cdf34098748337b0d7bc39dba'/>
<id>urn:sha1:32effc6657c1802cdf34098748337b0d7bc39dba</id>
<content type='text'>
This is work in progress, and fairly untested.

This adds initial tracking of styled underlines. Setting attributes
seems to work (both color and underline style). Grid reflow has *not*
been tested.

When rendering, style is currently ignored (all styles are rendered as
a plain, legacy underline).

Color however, *is* applied.
</content>
</entry>
<entry>
<title>render: single-pixel: minor optimization</title>
<updated>2024-05-22T11:48:46Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-05-22T11:38:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=708ca3d650dc16372eeed5f1c6bed62d01c5c408'/>
<id>urn:sha1:708ca3d650dc16372eeed5f1c6bed62d01c5c408</id>
<content type='text'>
Don't re-create the single-pixel buffer, unless necessary.

The buffer itself doesn't have a size. That means we can re-use the
buffer if the last frame's overlay style matches the current frame's
style.

What we *do not* know is whether the current frame's size is the same
as the last frame's.

This means we still have to set the viewport destination, and commit
the surface.
</content>
</entry>
<entry>
<title>render: use single-pixel buffers for overlays, when possible</title>
<updated>2024-05-22T11:48:46Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-05-21T14:09:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3c96d0b68e3f3d270e885c4d7bb82ae8667ba385'/>
<id>urn:sha1:3c96d0b68e3f3d270e885c4d7bb82ae8667ba385</id>
<content type='text'>
The unicode-mode, and flash overlays are single color buffers. This
means we can use the single-pixel buffer protocol.

It's undefined whether the compositor will release the buffer or not;
to make things easier, simply destroy the buffer as soon as we've
committed it.

Note that since compositors don't necessarily release single-pixel
buffers, we can't plug them into our own buffer interface. This means
we can't use buffer pointers to check if we can re-use the previous
buffer (i.e. we can skip comitting a new buffer), or if we have to
create a new one.

It's _almost_ enough to just check if the last overlay style is the
same as the current one. Except that that doesn't take window resizes
into account...
</content>
</entry>
<entry>
<title>unicode-mode: move state from seat to term</title>
<updated>2024-05-21T06:36:56Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-05-21T05:06:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=18b702b2495d4fb9328930eed9875731cff4cbde'/>
<id>urn:sha1:18b702b2495d4fb9328930eed9875731cff4cbde</id>
<content type='text'>
This fixes an issue where entering unicode-mode in one foot client,
also enabled unicode-mode on other foot clients. Both
visually (although glitchy), and in effect.

The reason the state was originally in the seat objects, was to fully
support multi-seat. That is, one seat/keyboard entering unicode-mode
should not affect other seats/keyboards.

The issue with this is that seat objects are Wayland global. Thus, in
server mode, all seat objects are shared between the foot clients.

There is a similarity with IME, which also keeps state in the
seat. There's one big difference, however, and that is IME has Wayland
native enter/leave events, that the compositor emits when windows are
focused/unfocused. These events allow us to reset IME state. For our
own Unicode mode, there is nothing similar.

This patch moves the Unicode state from seats, to the terminal
struct. This does mean that if one seat/keyboard enters Unicode mode,
then *all* seats/keyboards will affect the unicode state. This
potential downside is outweighed by the fact that different foot
clients no longer affect each other.

Closes #1717
</content>
</entry>
<entry>
<title>config: add cursor.unfocused-style</title>
<updated>2024-04-10T14:24:10Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-04-09T14:28:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e5a2ac4b57c18556e2245ecbf2e4faeef46e2b9d'/>
<id>urn:sha1:e5a2ac4b57c18556e2245ecbf2e4faeef46e2b9d</id>
<content type='text'>
This option controls how we render the cursor when the terminal window
is unfocused.

Possible values are:

* hollow: the default, and how we rendered the cursor before this
  patch.
* unchanged: render the cursor exactly the same way as when the window
  is focused.
* none: do not render any cursor at all

Closes #1582
</content>
</entry>
<entry>
<title>wayland: skip loading cursor theme when using server side cursors</title>
<updated>2024-03-16T14:36:44Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-03-16T14:30:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=578765ad8358b74949ad1296703aec4dec7d004a'/>
<id>urn:sha1:578765ad8358b74949ad1296703aec4dec7d004a</id>
<content type='text'>
We don't need the client side cursor theme when using server side
cursors.
</content>
</entry>
</feed>
