diff options
Diffstat (limited to 'src/protocol/endpoint.rs')
| -rw-r--r-- | src/protocol/endpoint.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/protocol/endpoint.rs b/src/protocol/endpoint.rs index 640e594e..2f7c8338 100644 --- a/src/protocol/endpoint.rs +++ b/src/protocol/endpoint.rs @@ -46,6 +46,9 @@ pub struct EndpointClientHello { pub mouse_capture: bool, #[serde(default = "default_true")] pub surface_active: bool, + /// Accept the optional cell-retaining surface encoding on this connection. + #[serde(default)] + pub surface_reuse: bool, #[serde(default)] pub snapshot_codecs: Vec<String>, #[serde(default)] @@ -139,6 +142,7 @@ impl EndpointServerWelcome { blob_codec: BLOB_CODEC_V1.into(), methods, capabilities: vec![ + super::surface_reuse::CAPABILITY.into(), SURFACE_INTEREST_CAPABILITY.into(), PRESENTATION_EFFECTS_FENCE_CAPABILITY.into(), HEALTH_CHECK_CAPABILITY.into(), @@ -181,6 +185,7 @@ mod tests { endpoint_keybindings: false, mouse_capture: true, surface_active: true, + surface_reuse: false, snapshot_codecs: vec![SNAPSHOT_CODEC_V1.into()], surface_codecs: vec![SURFACE_CODEC_V1.into()], input_codecs: vec![INPUT_CODEC_V1.into()], @@ -327,8 +332,10 @@ mod tests { fn legacy_hello_defaults_to_an_active_surface() { let mut value = serde_json::to_value(hello()).unwrap(); value.as_object_mut().unwrap().remove("surface_active"); + value.as_object_mut().unwrap().remove("surface_reuse"); let decoded: EndpointClientHello = serde_json::from_value(value).unwrap(); assert!(decoded.surface_active); + assert!(!decoded.surface_reuse); } #[test] @@ -337,6 +344,7 @@ mod tests { assert_eq!( welcome.capabilities, vec