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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// SPDX-License-Identifier: GPL-3.0-or-later
//! Visual and haptic feedback while the pointer pushes against a screen edge
//! and after it lands on this machine.
//!
//! # Backend contract
//!
//! - [`start`] runs once at daemon startup on a tokio thread. A backend creates
//! its channel with [`channel`], moves the receiver to its own OS UI thread
//! and returns the [`Feedback`]. It returns `None` when it cannot start;
//! it logs nothing and never panics.
//! - The UI thread owns every window or OS object. Commands arrive on a
//! bounded channel (read it with `blocking_recv`). The sender never blocks
//! and drops commands when the thread is behind, so the backend must treat
//! every command as absolute state, never as a delta.
//! - Never steal focus, never take input, and make every window click-through
//! and invisible to screen capture where the OS allows it. Nothing may
//! appear in the task bar, dock or window switcher.
//! - Honouring the OS reduce-motion setting is the backend's job: with it on,
//! show the same state without animation (for example a static edge strip
//! and a landing marker that does not pulse).
//! - Never log positions or progress.
//! - Commands:
//! - [`Command::Edge`]: draw the push glow along `edge` of the display
//! `display` (desktop coordinates; the daemon sends the bounds of the
//! whole local desktop it captures or injects in, so a backend that knows
//! per-monitor bounds clamps the glow to the monitor containing the
//! pointer). `progress` runs 0..=1000 per-mille of the resistance that
//! is built up; the glow grows with it. Repeated commands update it.
//! - [`Command::Clear`]: remove the glow at once (push ended, crossing,
//! pause, focus moved or the setting turned off).
//! - [`Command::Landing`]: briefly mark the desktop point `(x, y)` where the
//! pointer landed, then fade out on its own.
//! - [`Command::Tick`]: one trackpad haptic tick. The daemon only sends it
//! when the user enabled haptics; backends without haptics ignore it.
use Edge;
use mpsc;
use crateBounds;
/// Commands the daemon may queue before the backend catches up.
const COMMAND_CAPACITY: usize = 16;
/// Handle to a running feedback backend.
/// A feedback handle and the receiver its backend thread reads.
/// Whether this session can show feedback: Windows, macOS and X11.
/// Starts the backend, or returns `None` when this session has none.
/// Whether this OS can play haptic ticks.
pub const
use start as platform_start;
use start as platform_start;
use start as platform_start;