<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/render.c, branch 1.13.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.13.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.13.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2022-08-04T12:23:03Z</updated>
<entry>
<title>Add support for xdg_toplevel.wm_capabilities</title>
<updated>2022-08-04T12:23:03Z</updated>
<author>
<name>Simon Ser</name>
<email>contact@emersion.fr</email>
</author>
<published>2022-05-06T18:05:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=129e1a9b8e23007026d19c970941ccbc8ee2f0ca'/>
<id>urn:sha1:129e1a9b8e23007026d19c970941ccbc8ee2f0ca</id>
<content type='text'>
See https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/122
</content>
</entry>
<entry>
<title>config: add colors.search-box-{no-,}match</title>
<updated>2022-07-28T17:02:56Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-07-27T17:14:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d79a3b9350ba864464229a1c188e2f696fac5a26'/>
<id>urn:sha1:d79a3b9350ba864464229a1c188e2f696fac5a26</id>
<content type='text'>
Closes #1112
</content>
</entry>
<entry>
<title>render: it’s unlikely() the current cell is where the cursor is</title>
<updated>2022-07-28T16:55:34Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-07-28T16:55:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=24c2d568042c6fb0533071aaf72b64405ca2c324'/>
<id>urn:sha1:24c2d568042c6fb0533071aaf72b64405ca2c324</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ime: track IME focus independently from keyboard focus</title>
<updated>2022-06-15T17:25:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-06-15T16:41:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=96f23b4c6436d314ae4272f5f99c51b8e33556eb'/>
<id>urn:sha1:96f23b4c6436d314ae4272f5f99c51b8e33556eb</id>
<content type='text'>
Replace the seat-&gt;ime.focused boolean with a terminal instace pointer,
seat-&gt;ime_focus.

Set and reset this on ime::enter() and ime::leave() events, and use
this instead of seat-&gt;kbd_focus on all other IME events.

This fixes two issues:

a) buggy compositors that sometimes sends an IME enter event without
  first having sent a keyboard enter event.

b) seats may be IME capable while still lacking the keyboard
  capability. Such seats will *always* see IME enter events without a
  corresponding keyboard enter event.
</content>
</entry>
<entry>
<title>render: fix refresh logic of pending csd|search|url</title>
<updated>2022-04-24T10:04:06Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-24T10:04:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2cbcfb315909969c126f9fd322c68236151a17e7'/>
<id>urn:sha1:2cbcfb315909969c126f9fd322c68236151a17e7</id>
<content type='text'>
Our CSDs, the search-box and URL labels are all implemented using
sub-surfaces, synchronized with the main grid.

This means we *must* commit the main surface as well, when updating
one of these sub-surfaces.

The logic for doing so in the frame callback was flawed, and only
triggered when the main grid was actually dirty.

That is, e.g. search box updates that did not also resulted in grid
updates (for example - pasting a search criteria that doesn’t match),
did not result in a UI refresh.

Closes #1040
</content>
</entry>
<entry>
<title>render: overlay: reset ‘start_col’ after handling the first row</title>
<updated>2022-04-17T17:26:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-17T17:26:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2085621bf471ad6f944d52268b7441b590aeb5cc'/>
<id>urn:sha1:2085621bf471ad6f944d52268b7441b590aeb5cc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: refactor: remove ‘struct config’ pointer from wayland struct</title>
<updated>2022-04-17T14:34:04Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-17T14:29:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=24ee3dcc10c5e1cf57456cc39fa0b5e8700a06ed'/>
<id>urn:sha1:24ee3dcc10c5e1cf57456cc39fa0b5e8700a06ed</id>
<content type='text'>
The global config doesn’t necessarily reflect the correct
configuration to use - we should *always* use the current terminal
instance’s conf pointer.

* Move selection override modifier mask to the key_binding_set struct
* Always warn if XDG activation is unavailable, not just if
  bell.urgent is set (we no longer have access to this information)
* Pass ‘bool presentation_timings’ as a parameter to wayl_init()
* Remove ‘presentation_timings’ member from the ‘terminal’ struct

Closes #932
</content>
</entry>
<entry>
<title>render: overlay: apply weston quirk</title>
<updated>2022-04-17T09:04:27Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-17T09:04:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9e3c71c27735ae3a534affc71e26a82e0310c96b'/>
<id>urn:sha1:9e3c71c27735ae3a534affc71e26a82e0310c96b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>search/render: initial support for highlighting all visible matches</title>
<updated>2022-04-16T17:26:20Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-09T15:57:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=90c91d61482920881bb0c1ecf4babc001b3f598d'/>
<id>urn:sha1:90c91d61482920881bb0c1ecf4babc001b3f598d</id>
<content type='text'>
Before this patch, only the currently “selected” match was
highlighted (by having the “selected” attribute, and by *not* dimming
it, like the rest of the grid during a scrollback search).

With this patch, we now highlight matches within the viewport. While
searching, only the “primary” match is searched-for, and tracked.

Then, when rendering a frame, we find all “secondary” matches as
well. “holes” are added to the search-mode overlay by the means of an
search-match iterator.

The iterator’s text matching logic is *very* similar to what we do
when the search criteria has been updated, and we re-search the
scrollback. It should be possible to refactor this, and share code.
</content>
</entry>
<entry>
<title>render: implement ‘flash’ and search mode’s ‘dimming’ with a sub-surface</title>
<updated>2022-04-16T16:31:02Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-16T15:49:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=78fcdc578755af0c3a52a46521dbb4d9804ab790'/>
<id>urn:sha1:78fcdc578755af0c3a52a46521dbb4d9804ab790</id>
<content type='text'>
Search mode and ‘flash’ (OSC-555) both achieves similar visual
effects: flash tints the entire window yellow, and search mode dims
it (except the search match).

But, they do so in completely different ways. Search mode is detected
in render_cell(), and the colors are then dimmed there.

Flash is implemented by blending a yellow, semi-transparent color on
top of the rendered grid.

This patch replaces those two implementations with a single one. We
add a new sub-surface, called the ‘overlay’. In normal mode, it’s
unmapped.

When either search mode, or flash, is enabled, we enable it, and
fill it with a semi-transparent color. Yellow for ‘flash’, and
“black” (i.e. no color) for search mode.

The compositor then blends it with the grid. Hopefully on the GPU,
meaning it’ll be faster than if we blend in software.

There are more performance benefits however. By using a separate
surface, we can do much better damage tracking.

The normal grid rendering code no longer have to care about neither
search mode, nor flash. Thus, we get rid of a couple of ‘if’
statements in render_cell(), which is nice. But more importantly, we
can drop full grid repaints in a couple of circumstances:

* Entering/exiting search mode
* Every frame while flash is active

Now, when rendering the search mode overlay, we do want to do some
damage tracking, also of the overlay.

This, since search mode doesn’t dim the *entire* window. The search
match is *not* dimmed. This is implemented by punching a hole in the
overlay sub-surface. That is, we make part of it *fully*
transparent. The basic idea is to set a clip region that excludes the
search match, and then dim the rest of the overlay.

It’s slightly more complicated than that however, if we want to reuse
the last frame’s overlay buffer (i.e we don’t want to re-render
the *entire* overlay every frame).

In short, we need to:

* Clear (punch hole) in areas that are part of this frame’s search
  match, but not the last frame’s (since those parts are _already_
  cleared).
* Dim the areas that were part of the last frame’s search match, but
  aren’t anymore (the rest of the overlay should already be dimmed).

To do this, we save the last frame’s “holes” (as a pixman
region). Then, when rendering the next frame, we first calculate the
new frame’s “holes” region.

The region to clear is “this frame’s holes minus last frame’s holes”
The region to dim is “last frame’s holes minus this frames holes”.

Finally, we compute the bounding box of all modified cells by taking
the union of the two diff regions mentioned above. This allows us to
limit the buffer damage sent to the compositor.
</content>
</entry>
<entry>
<title>wayland: optionally disable pointer input on subsurfaces</title>
<updated>2022-04-16T15:41:14Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-16T15:41:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=129deaffa82650a1383f5816aa46f4a78a73b2ed'/>
<id>urn:sha1:129deaffa82650a1383f5816aa46f4a78a73b2ed</id>
<content type='text'>
We have a number of sub-surfaces for which we are *not* interrested in
pointer (or touch) input.

Up until now, we’ve manually dealt with these, by recognizing these
surfaces in all pointer events, and ignoring them.

But, lo and behold, there are better ways of doing this. By clearing
the subsurface’s input region, the compositor will do this for us -
when a pointer is outside a surface’s input region, the event is
passed to the next surface underneath it.

This is exactly what we want! Do this for all subsurfaces, *except*
the CSDs.
</content>
</entry>
<entry>
<title>render: take (visible) CSD border size into account when setting initial size</title>
<updated>2022-04-16T09:42:26Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-16T09:37:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=979f48a62f4d42f0d9637976cacf16d7bbcb2b84'/>
<id>urn:sha1:979f48a62f4d42f0d9637976cacf16d7bbcb2b84</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wayland: add helper functions wayl_win_csd_{titlebar,borders}_visible()</title>
<updated>2022-04-16T09:42:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-16T09:26:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f9103d4381cab9d6c10024ab8fbcdb35b14ef239'/>
<id>urn:sha1:f9103d4381cab9d6c10024ab8fbcdb35b14ef239</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: take visible border width into account when setting window geometry</title>
<updated>2022-04-16T08:57:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-16T08:47:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0e477e2c5e55fd391aa5adef32789a9b7c3f3024'/>
<id>urn:sha1:0e477e2c5e55fd391aa5adef32789a9b7c3f3024</id>
<content type='text'>
This fixes e.g. window snapping in GNOME.
</content>
</entry>
<entry>
<title>refactor: add a ‘range’ struct, grouping a start and end coord together</title>
<updated>2022-04-09T13:09:02Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-09T13:09:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5b1f1602bccfb7c37e50a8509f44b24e9aa3b5d1'/>
<id>urn:sha1:5b1f1602bccfb7c37e50a8509f44b24e9aa3b5d1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: ensure an underline cursor is not positioned too low</title>
<updated>2022-04-06T16:17:59Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-05T17:18:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5ce1589c60feb7a9c41377f732955f6108d183ac'/>
<id>urn:sha1:5ce1589c60feb7a9c41377f732955f6108d183ac</id>
<content type='text'>
The underline cursor is positioned just below regular underlines. A
bug in the positioning logic related to this, sometimes resulted in
the cursor being thinner than what it should be, or even invisible.

Fixes #1005
</content>
</entry>
<entry>
<title>config: rename csd.color.close -&gt; quit</title>
<updated>2022-02-09T16:51:05Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-02-08T19:12:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=757768dbe5a61a5fbfc628ad554f26add0397e42'/>
<id>urn:sha1:757768dbe5a61a5fbfc628ad554f26add0397e42</id>
<content type='text'>
This fixes a compilation error on FreeBSD:

../../foot/render.c:2055:45: error: no member named 'epoll_shim_close' in 'struct config::(anonymous at ../../foot/config.h:254:9)'
        conf_color = &amp;term-&gt;conf-&gt;csd.color.close;
                      ~~~~~~~~~~~~~~~~~~~~~ ^

/usr/local/include/libepoll-shim/epoll-shim/detail/common.h:8:15:
note: expanded from macro 'close': #define close epoll_shim_close
</content>
</entry>
<entry>
<title>Specify a fallback mouse cursor</title>
<updated>2022-02-07T16:45:47Z</updated>
<author>
<name>Ashish SHUKLA</name>
<email>ashish.is@lostca.se</email>
</author>
<published>2022-02-07T15:02:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4df73585e79485280fda2e60c18bbac36eaee491'/>
<id>urn:sha1:4df73585e79485280fda2e60c18bbac36eaee491</id>
<content type='text'>
`text' cursor is not available in lots of cursor themes, but `xterm'
is, so specify `xterm' as a fallback cursor name.
</content>
</entry>
<entry>
<title>render: add render_xcursor_is_valid()</title>
<updated>2022-02-07T16:28:37Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-01T12:56:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e4f9dc7d581cf134e850bd02a9c4ae3e5989905a'/>
<id>urn:sha1:e4f9dc7d581cf134e850bd02a9c4ae3e5989905a</id>
<content type='text'>
Returns true if the provided cursor name is non-NULL, and exist in the
currently loaded xcursor theme.
</content>
</entry>
<entry>
<title>render: call wl_cursor_theme_get_cursor() earlier</title>
<updated>2022-02-07T16:28:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-01T12:51:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=92ebe00927b4c9113d6921f2c70a3f609b8785a9'/>
<id>urn:sha1:92ebe00927b4c9113d6921f2c70a3f609b8785a9</id>
<content type='text'>
Before this patch, wl_cursor_theme_get_cursor() was called in the FDM
hook, just before we’re about to update the mouse cursor “for real”.

This relies on seat-&gt;pointer.xcursor still being valid. This is true
as long as we’re only using our compiled-in static xcursor names, but
not otherwise.

Now, we call wl_cursor_theme_get_cursor() in render_xcursor_set(). At
this point, we *know* seat-&gt;pointer.xcursor is valid.

There is a slight chance of added overhead here, if the client
application is switching mouse grabbing on/off rapidly. Before, the
calls to wl_cursor_theme_get_cursor() would automatically be
throttled.

However, the main point of delaying the actual pointer update to the FDM
hook is to throttle the *Wayland* calls. And this is still happening:
wl_cursor_theme_get_cursor() is client-side only.
</content>
</entry>
</feed>
