mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-25 09:05:47 -04:00
wayland: do all surface unmap and roundtrips before waiting for pre-apply damage
The pre-apply damage thread may be running when we destroy a terminal instance, and we need to wait for it to finish before destroying the underlying buffer.c291194a4edid this, but failed to realize the thread may get re-started in the roundtrips done later in wayl_win_destroy(); after the wait added inc291194a4e, we unmap all surfaces (including the main grid), and roundtrip. This means the compositor will release the currently active buffer, and that means _we_ will trigger the pre-apply damage thread on it. This introduces a race, where wayl_win_destroy() may reach its shm_purge() calls before the pre-apply damage thread has finished. That typically causes foot to crash. Closes #2288
This commit is contained in:
parent
4fd682b4e8
commit
657db18a4e
2 changed files with 5 additions and 2 deletions
|
|
@ -77,8 +77,11 @@
|
||||||
|
|
||||||
* Wrong documented default value for `initial-color-theme` in
|
* Wrong documented default value for `initial-color-theme` in
|
||||||
`foot.ini(5)` ([#2292][2292]).
|
`foot.ini(5)` ([#2292][2292]).
|
||||||
|
* Occasional crashes when closing a window and
|
||||||
|
`tweak.pre-apply-damage=yes` (the default) ([#2288][2288]).
|
||||||
|
|
||||||
[2292]: https://codeberg.org/dnkl/foot/issues/2292
|
[2292]: https://codeberg.org/dnkl/foot/issues/2292
|
||||||
|
[2288]: https://codeberg.org/dnkl/foot/issues/2288
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
|
||||||
|
|
@ -2177,8 +2177,6 @@ wayl_win_destroy(struct wl_window *win)
|
||||||
|
|
||||||
struct terminal *term = win->term;
|
struct terminal *term = win->term;
|
||||||
|
|
||||||
render_wait_for_preapply_damage(term);
|
|
||||||
|
|
||||||
if (win->csd.move_timeout_fd != -1)
|
if (win->csd.move_timeout_fd != -1)
|
||||||
close(win->csd.move_timeout_fd);
|
close(win->csd.move_timeout_fd);
|
||||||
|
|
||||||
|
|
@ -2236,6 +2234,8 @@ wayl_win_destroy(struct wl_window *win)
|
||||||
tll_remove(win->urls, it);
|
tll_remove(win->urls, it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
render_wait_for_preapply_damage(term);
|
||||||
|
|
||||||
csd_destroy(win);
|
csd_destroy(win);
|
||||||
wayl_win_subsurface_destroy(&win->search);
|
wayl_win_subsurface_destroy(&win->search);
|
||||||
wayl_win_subsurface_destroy(&win->scrollback_indicator);
|
wayl_win_subsurface_destroy(&win->scrollback_indicator);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue