1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Quitting: the one thing a game cannot do the same way on every platform.
//!
//! `std::process::exit` is `unreachable` on `wasm32-unknown-unknown`: it traps
//! the instance and strands every winit `RefCell` guard, so the next event
//! panics with "RefCell already borrowed". A browser has no window to close
//! and no exit to call, so a quit there latches instead: the shell keeps
//! servicing frames while the app stops stepping and paints [`Quit::parked`],
//! leaving the tab to be closed.
use View;
use Modifier;
use ZStack;
/// A quit request, latched so a browser shell can park instead of exiting.