Pass a damage region to render_row()/render_cell() when rendering
partially visible cells underneath a sixel.
This ensures the affected regions are later reported as 'damaged' to
the Wayland compositor.
Closes#1515
When erasing a sixel, the cells underneath it must be marked as
'dirty', in order to be re-rendered.
This was not being done correctly; the for loop loops *from* the start
col, meaning the *end* col is *not* sixel->pos.col, as that's
the *number* of columns, not the *end* column.
MFD_NOEXEC_SEAL was introduced in linux 6.3. Kernels before that
will *reject* memfd_create() calls that set it.
This caused foot to exit (i.e. not start at all), when compiled on
linux >= 6.3, but run on linux < 6.3.
We _do_ want to use MFD_NOEXEC_SEAL, since a) our memory mapped really
shouldn't be executable, and b) to silence a warning on linux >= 6.3.
To handle all cases, first try *with* MFD_NOEXEC_SEAL. If that fails
with EINVAL, retry *without* it.
Closes#1514
When using the font's own line-height, simply set the baseline
'descent' pixels above the bottom of the cell.
This fixes an issue where some fonts appeared "glued" to the top of
the cell, and sometimes getting partially clipped.
This reverts commit fd813d0e6c.
The intent of the reverted commit was to align font height calculation
with cell height calculation. However, it turns out this breaks some
fonts. Typically those with large:ish differences in their 'height'
attribute, and their ascent+descent value.
Closes#1511
Before this patch. Wayland surface damage tracking was done on a
per-row basis. That is, even if just one cell was updated, the entire
row was "damaged".
Now, damage is per cell. This hopefully results in lower latencies in
many use cases, and especially on high DPI monitors.
The has_wrapped_around_{right,left} functions were mixed up, causing
false positives and false negatives, resulting in bad search matches.
Also make all search_extend_find* functions return a boolean; false
means no change in the selection. In this case, we can skip trying to
extend the selection, and updating the UI.
This patch adds the following new search key bindings:
* extend-char (shift+right)
* extend-line-down (shift+down)
* extend-backward-char (shift+left)
* extend-backward-to-word-boundary (ctrl+shift+left)
* extend-backward-to-next-whitespace (ctrl+shift+alt+left)
* extend-line-up (shift+up)
They can be used to extend the search match (i.e. the selection).
This patch also adds an initial set of key bindings to scroll in the
scrollback history:
* scrollback-up-page
* scrollback-down-page
These work just like the key bindings for the normal mode. Also note
that it was already possible to scroll using the mouse.
This patch also fixes a couple of search mode bugs:
* crashing when a search match ends in the last column
* grapheme clusters not being matched correctly
* Search match not being "extendable" after a pointer leave event
* A few others, related to either large matches, or extending matches
after moving the viewport.
There are still a couple of (known) issues:
* A search match isn't correctly highlighted if its *starting* point
is outside the viewport.
* Extending the match to end of the scrollback (i.e. the most recent
output) is simply buggy.
Related to #419
Effective from Linux 6.3.0 onward, this creates the memfd without
execute permissions and prevents that setting from ever being changed.
This is a defense-in-depth security measure and prevents a respective
kernel warning from being emitted.
See https://lwn.net/Articles/918106/ for more information.
Seen on plasma; monitor is turned off, and then back on again. Before
the "new" output global is emitted, the compositor calls
fractional_scale::preferred_scale().
This results in a call to get_font_dpi(), where we crash, since it
assumes there is at least one monitor available.
Fix by falling back to a DPI of 96.
Hopefully closes#1498
Previously, foot -a test wouldn't actually set the app ID if there was
no config file and the defaults were used, which was very
counterintuitive.
Now, load_config() will carry on until the end, even if there's no
config file, so overrides still work.