@desklink/host 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -9
- package/bin/desklink-host.mjs +2 -1
- package/dist/bridge.d.ts +3 -4
- package/dist/bridge.d.ts.map +1 -1
- package/dist/bridge.js +18 -7
- package/dist/bridge.js.map +1 -1
- package/dist/engineProcess.d.ts.map +1 -1
- package/dist/engineProcess.js +0 -1
- package/dist/engineProcess.js.map +1 -1
- package/dist/protocol.d.ts +4 -3
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js.map +1 -1
- package/docs/BOUNDARY.md +8 -8
- package/docs/PROTOCOL.md +72 -45
- package/engine/Cargo.lock +1 -1
- package/engine/Cargo.toml +1 -1
- package/engine/build.rs +1 -0
- package/engine/native/agent_indicator.h +57 -0
- package/engine/native/agent_overlay_wayland.c +47 -26
- package/engine/native/agent_overlay_x11.c +116 -57
- package/engine/src/capture.rs +4 -2
- package/engine/src/clipboard.rs +174 -0
- package/engine/src/indicator.rs +175 -10
- package/engine/src/main.rs +2 -2
- package/engine/src/peer.rs +10 -4
- package/engine/src/protocol.rs +7 -10
- package/engine/src/session.rs +305 -209
- package/engine/src/x11.rs +29 -29
- package/engine/src/x11_mac.rs +4 -0
- package/examples/reference-client.html +3 -5
- package/package.json +3 -3
package/engine/src/main.rs
CHANGED
|
@@ -310,7 +310,7 @@ fn print_input_setup() {
|
|
|
310
310
|
println!(
|
|
311
311
|
"To undo it: remove the rule, remove the user from the group, reload the rules."
|
|
312
312
|
);
|
|
313
|
-
println!("Without it the engine still captures the desktop
|
|
313
|
+
println!("Without it the engine still captures the desktop; input actions are refused with input-unavailable.");
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
}
|
|
@@ -645,7 +645,6 @@ async fn dispatch(
|
|
|
645
645
|
let open = session::OpenRequest {
|
|
646
646
|
source: params.source,
|
|
647
647
|
cursor: params.cursor,
|
|
648
|
-
permissions: params.permissions,
|
|
649
648
|
max_width: params.max_width,
|
|
650
649
|
max_height: params.max_height,
|
|
651
650
|
bitrate_kbps: params.bitrate_kbps,
|
|
@@ -680,6 +679,7 @@ async fn dispatch(
|
|
|
680
679
|
},
|
|
681
680
|
"geometry": session.geometry(),
|
|
682
681
|
"cursor": session.cursor_info(),
|
|
682
|
+
"agentIndicator": session.agent_indicator(),
|
|
683
683
|
});
|
|
684
684
|
*current = Some(session);
|
|
685
685
|
Ok(result)
|
package/engine/src/peer.rs
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
//! module never assumes anything about that channel, which is what keeps the
|
|
6
6
|
//! engine usable by an application that is not this one.
|
|
7
7
|
//!
|
|
8
|
-
//!
|
|
9
|
-
//!
|
|
10
|
-
//!
|
|
11
|
-
//!
|
|
8
|
+
//! Remote input and clipboard ride the session's data channel; co-located
|
|
9
|
+
//! consumers can also use the local clipboard protocol. The channel is inside
|
|
10
|
+
//! the DTLS/SRTP session opened by a paired consumer and dies with it — a revoked
|
|
11
|
+
//! session cannot be driven by a client that kept a socket open.
|
|
12
12
|
|
|
13
13
|
use anyhow::{Context, Result};
|
|
14
14
|
use rtc::interceptor::{
|
|
@@ -1120,6 +1120,12 @@ impl VideoPeer {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
|
|
1122
1122
|
pub async fn close(&self) {
|
|
1123
|
+
let _ = tokio::time::timeout(Duration::from_millis(500), async {
|
|
1124
|
+
while self.control.outstanding_bytes().await.unwrap_or(0) > 0 {
|
|
1125
|
+
tokio::time::sleep(Duration::from_millis(5)).await;
|
|
1126
|
+
}
|
|
1127
|
+
})
|
|
1128
|
+
.await;
|
|
1123
1129
|
self.feedback.abort();
|
|
1124
1130
|
let _ = self.control.close().await;
|
|
1125
1131
|
let _ = self.peer.close().await;
|
package/engine/src/protocol.rs
CHANGED
|
@@ -53,14 +53,6 @@ pub struct HelloParams {
|
|
|
53
53
|
pub protocol: u32,
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
|
57
|
-
#[serde(rename_all = "snake_case")]
|
|
58
|
-
pub enum Permission {
|
|
59
|
-
View,
|
|
60
|
-
Control,
|
|
61
|
-
Clipboard,
|
|
62
|
-
}
|
|
63
|
-
|
|
64
56
|
#[derive(Debug, Clone, Deserialize)]
|
|
65
57
|
pub struct IceServerParam {
|
|
66
58
|
#[serde(default)]
|
|
@@ -126,8 +118,6 @@ pub struct OpenParams {
|
|
|
126
118
|
/// Absent means "the portal, with the user's consent".
|
|
127
119
|
#[serde(default)]
|
|
128
120
|
pub source: Option<SourceRequest>,
|
|
129
|
-
#[serde(default)]
|
|
130
|
-
pub permissions: Vec<Permission>,
|
|
131
121
|
#[serde(default = "default_max_width")]
|
|
132
122
|
pub max_width: usize,
|
|
133
123
|
#[serde(default = "default_max_height")]
|
|
@@ -539,6 +529,13 @@ mod tests {
|
|
|
539
529
|
|
|
540
530
|
#[test]
|
|
541
531
|
fn open_defaults_keep_the_desktops_own_pixels_up_to_4k() {
|
|
532
|
+
for payload in [
|
|
533
|
+
r#"{}"#,
|
|
534
|
+
r#"{"permissions":["view"]}"#,
|
|
535
|
+
r#"{"permissions":["view","unknown-legacy-scope"]}"#,
|
|
536
|
+
] {
|
|
537
|
+
let _: OpenParams = serde_json::from_str(payload).unwrap();
|
|
538
|
+
}
|
|
542
539
|
let params: OpenParams =
|
|
543
540
|
serde_json::from_str(r#"{"permissions":["view","control"]}"#).unwrap();
|
|
544
541
|
assert_eq!(params.max_width, 3840);
|