mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-08 05:34:00 -04:00
render: throttle xcursor updates
With a bad behaving client (e.g. 'less' with mouse support enabled), we can end up with a *lot* of xcursor updates (so much, that we flooded the wayland socket before we implemented a blocking wayl_flush()). Since there's little point in updating the cursor more than once per frame interval, use frame callbacks to throttle the updates. This works more or lesslike normal terminal refreshes: render_xcursor_set() stores the last terminal (window) that had (and updated) the cursor. The renderer's FDM hook checks if we have such a pending terminal set, and if so, tries to refresh the cursor. This is done by first checking if we're already waiting for a callback from a previous cursor update, and if so we do nothing; the callback will update the cursor for the next frame. If we're *not* already waiting for a callback, we update the cursor immediately.
This commit is contained in:
parent
040a1cd00d
commit
5ec447697c
5 changed files with 136 additions and 76 deletions
|
|
@ -1674,7 +1674,7 @@ term_xcursor_update(struct terminal *term)
|
|||
selection_enabled(term) ? XCURSOR_TEXT :
|
||||
XCURSOR_HAND2;
|
||||
|
||||
wayl_cursor_set(term->wl, term);
|
||||
render_xcursor_set(term);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue