Files
vectorcraft/crates
dotCooCoo dd676a4243 Font menu: the app keeps responding when a sample finishes while a font field is drawn
A font family field looked up its wheel state with
`ui.data(|d| ... ui.ctx().viewport_id() ...)`, in two places. The
closure of `ui.data` runs with the egui context read-locked, and
`viewport_id()` locks it for reading again. The threads that render
the menu's samples call `request_repaint()` when they finish, which
locks the context for writing. A write request that arrives between
the two reads waits for the first read to end, and the second read
waits behind the write request, so neither thread goes on. A release
build stays blocked; a debug build of egui panics after ten seconds
with "Failed to acquire RwLock read after 10s".

`font_menu` now reads the viewport id once, before either `ui.data`
call, and uses the resulting id in both.

The new test draws a closed font field for 2,000 passes while four
threads call `request_repaint()` on the same context. With either
lookup put back inside its closure, it fails with that panic.
2026-11-13 05:34:57 -08:00
..
…
…
…