mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-07 04:34:03 -05:00
wayland: don't use wl_display_dispatch()
wl_display_dispatch() calls poll(), which is unnecessary since we already know the FD is readable. Use the more lower level wl_display_read_events() + wl_display_dispatch_pending(). These require wl_display_prepare_read() to have been called. The idea is to call wl_display_prepare_read() **before** calling poll(). Thus, we do this more or less last in wayl_init(), and at the **end** of the FDM handler. However, having taking this lock also means we no longer can call wl_display_roundtrip() directly (it will hang). So, add a wrapper, wayl_roundtrip(), that cancels the read intent, does the roundtrip, and then re-acquires the read intent.
This commit is contained in:
parent
c6e46bbfac
commit
0ea0323d0f
3 changed files with 30 additions and 8 deletions
|
|
@ -659,9 +659,7 @@ term_init(const struct config *conf, struct fdm *fdm, struct wayland *wayl,
|
|||
|
||||
/* Let the Wayland backend know we exist */
|
||||
tll_push_back(wayl->terms, term);
|
||||
|
||||
/* Roundtrip to ensure the wayland window have been configured */
|
||||
wl_display_roundtrip(term->wl->display);
|
||||
wayl_roundtrip(term->wl);
|
||||
|
||||
term_set_window_title(term, "foot");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue