When going through the cached buffers, we only set buffer->busy on
the *first* re-usable buffer we found.
In some cases, we will find more than one re-usable buffer. In this
case, we select the “youngest” one (i.e the one most recently used, in
the hopes that we can use damage tracking instead of re-rendering the
entire buffer).
If the “current” buffer is younger than the previously detected,
re-usable, buffer, then we unref:ed the previously selected buffer,
and replaced it with the current one.
But, we did not sanitize it. That is, we did not:
* set buffer->busy
* clear its dirty region
* clear its scroll damage
That buffer would eventually get rendered to, and committed to the
compositor. Later, the compositor would free it. And there, in our
buffer_release() callback, we’d assert that buffer->busy was
set. And fail.
Closes#844
When handling “generic” keys (i.e. keys not in the Kitty keymap), we
use the pressed key’s Unicode codepoint as “key” in the kitty CSI.
If we failed to convert the XKB symbol to a Unicode codepoint, we used
to (before this patch), fallback to using the XKB symbol as is.
This can never be correct... and it caused us to emit a meaningless
CSI for XKB_KEY_ISO_Next_Group, which confused e.g. Kakoune.
These are new in version 4 of the wl_output interface (first included
in wayland-1.20).
This allows us to get the name and description of the outputs, also on
compositors without the XDG output interface.
This makes us slightly more resilient against a missing XDG output
interface.
We use the “real” (the physical) dimensions, combined with the scaling
factor, to estimate the logical dimensions.
This works out correctly with non-fractional scaling, but not
otherwise.
With this patch, key- and mouse-bindings structs (the non-layout
specific ones) are unified into a single struct.
The logic that parses, and manages, the key- and mouse binding lists
are almost identical. The *only* difference between a key- and a mouse
binding is that key bindings have an XKB symbol, and mouse bindings a
button and click-count.
The new, unified, struct uses a union around these, and all functions
that need to know which members to use/operate on now takes a ‘type’
parameter.
We want to handle SIGPIPEs without crashing... One way to trigger this
was to use e.g.
pipe-visible=[cat /foo/bar] Control+Shift+q
That is, pipe output to something that did not consume it. This led
to a SIGPIPE when we tried to write the terminal contents to the pipe,
and crashed the whole foot instance.
This allows the user to write, to swap two key bindings:
[key-bindings]
show-urls-launch=Control+Shift+r
search-start=Control+Shift+u
instead of:
[key-bindings]
search-start=none
show-urls-launch=Control+Shift+r
search-start=Control+Shift+u
This should simplify the configuration for people who replace a lot of
the default key bindings.
This also simplifies the parsing somewhat, since we no longer has to
parse a key-binding into a temporary list, ensure it doesn’t have any
collisions, and then copy it into the actual key binding list.
_While_ parsing a key-binding, we still need a temporary array (at
least for the time being), but that temporary array is no longer
visible outside the parsing function that allocates it.