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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! `GpuSurface` on Linux, for the GTK and Kirigami backends: a surface of
//! our own over the widget that keeps its space, which the app presents to
//! directly, and the pointer lock the toolkits don't offer.
//!
//! - Wayland ([`wayland`]): a `wl_surface`, a desync subsurface of the
//! window's surface, on the toolkit's connection. The toolkits' own
//! routes wait for their frame clocks: GTK's `GtkGraphicsOffload` showed
//! a frame more latency than a window of the app's own (2ksbox measured
//! it); a desync subsurface doesn't wait for the window's commits. The
//! pointer lock is `zwp_locked_pointer_v1` with relative motion, and Qt,
//! which has no API for it, inhibits the compositor's shortcuts with
//! `zwp_keyboard_shortcuts_inhibitor_v1`.
//! - X11 ([`x11`]): a child window of the window's, on an xcb connection of
//! our own, which the app may use from any thread. The pointer lock is a
//! pointer grab on it, the cursor warped back to its middle after each
//! move.
//!
//! Both take no input (an empty input region, an empty input shape), so
//! the toolkit keeps the pointer, and the backend places them over their
//! widget after each of the window's frames. Each lives as long as the
//! app's handle, so a GPU surface made on it never outlives it. Other
//! displays (GTK's Broadway, Qt's offscreen platform) get a [`NoSurface`].
//!
//! Pointer locks report on a thread of their own ([`LockEvent`]); the
//! backend sends what they report to its UI thread.
use ;
use ;
/// A surface on a display that has none to give (GTK's Broadway, Qt's
/// offscreen platform, which tests run on): the app is told of it and its
/// size, as headless tells it, but it has no handles to present to.
;
// SAFETY: it returns no handles.
unsafe
/// What a pointer lock or a shortcuts inhibitor reports, from a thread of
/// its own.
/// Where a lock reports, on its own thread.
pub type LockSink = ;