Expand description
Whether this process is allowed to open a window.
A backend stands up its window from deep inside device initialisation, and a process that reaches that point without an operating system to drive it does not fail: it blocks on an event loop that never ends. Under a test harness that is a hang with no failing assertion to read.
The policy is a process-wide latch a caller sets before it runs anything. Default is permissive, so a shipped binary behaves exactly as it did; a headless host forbids windows up front and gets a panic naming the backend instead of a hang.
Functionsยง
- allow_
windows - Lift the ban set by
forbid_windows, restoring the default. - assert_
windows_ allowed - Panic if windows are forbidden, naming
backendas what tried to open one. - forbid_
windows - Forbid window creation for the rest of the process, until
allow_windows. - windows_
forbidden - Whether window creation is currently forbidden.