mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
render: delay reflow for ‘resize-delay-ms’ milliseconds
Reflowing a large scrollback is *slow*. During an interactive resize, it can easily take long enough that the compositor fills the Wayland socket with configure events. Eventually, the socket becomes full and the compositor terminates the connection, causing foot to exit. This patch is work-in-progress, and the first step towards alleviating this. It delays the reflow by: * Snapshotting (copying) the original grid when an interactive resize is started. * While resizing, we apply a simple truncation resize of the grid (like we handle the alt screen). * When the resize is done, or paused for ‘resize-delay-ms’, the grid is reflowed. TODO: we *must* not allow any changes to the temporary (truncated) grid during the resize. Any changes to the grid would be lost when the final reflow is applied. That is, we must completely pause the ptmx pipe while a resize is in progress. Future improvements: The initial copy can be slow. We should be able to avoid it by rewriting the reflow algorithm to not free anything. This is complicated by the fact that some resources (e.g. sixel images) are currently *moved* to the new grid. They’d instead have to be copied.
This commit is contained in:
parent
a9fc7ce180
commit
8179d73daa
4 changed files with 123 additions and 20 deletions
|
|
@ -595,6 +595,11 @@ struct terminal {
|
|||
|
||||
size_t search_glyph_offset;
|
||||
|
||||
struct {
|
||||
struct grid *grid;
|
||||
int screen_rows;
|
||||
} resizing;
|
||||
|
||||
struct timespec input_time;
|
||||
} render;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue