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
39
40
41
//! 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. A parked root still says so on screen, and
//! the game should cut its audio (`repame_audio::Audio::silence`) so a
//! looping track does not play on over that message.
use View;
use Modifier;
use ;
/// A quit request, latched so a browser shell can park instead of exiting.