mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
wayland: wl_display_flush() never blocks
Since it doesn't block, we need to detect EAGAIN failures and ensure we actually flush everything. If we don't, we sooner or later end up in a wayland client library call that aborts due to the socket buffer being full. Ideally, we'd simply enable POLLOUT in the FDM. However, we cannot write *anything* to the wayland socket until we've actually managed to send everything. This means enabling POLLOUT in the FDM wont work since we may (*will*) end up trying to write more data to it before we've flushed it. So, add a wrapper function, wayl_flush(), that acts as a blocking variant of wl_display_flush(), by detecting EAGAIN failiures and calling poll() itself, on the wayland socket only, until all data has been sent.
This commit is contained in:
parent
2128d5912f
commit
abc36d8f09
3 changed files with 46 additions and 4 deletions
2
render.c
2
render.c
|
|
@ -867,7 +867,7 @@ grid_render(struct terminal *term)
|
|||
}
|
||||
|
||||
wl_surface_commit(term->window->surface);
|
||||
wl_display_flush(term->wl->display);
|
||||
wayl_flush(term->wl);
|
||||
|
||||
#if TIME_FRAME_RENDERING
|
||||
struct timeval end_time;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue