aboutsummaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/api')
-rw-r--r--src/api/schema.rs2
-rw-r--r--src/api/schema/common.rs6
-rw-r--r--src/api/schema/response.rs6
-rw-r--r--src/api/schema/server.rs6
-rw-r--r--src/api/schema/tests.rs2
-rw-r--r--src/api/server.rs13
6 files changed, 35 insertions, 0 deletions
diff --git a/src/api/schema.rs b/src/api/schema.rs
index 074cd4ed..ba9f0c3a 100644
--- a/src/api/schema.rs
+++ b/src/api/schema.rs
@@ -69,6 +69,8 @@ pub enum Method {
ClientWindowTitleSet(ClientWindowTitleSetParams),
#[serde(rename = "client.window_title.clear")]
ClientWindowTitleClear(EmptyParams),
+ #[serde(rename = "client_shell.surface.set")]
+ ClientShellSurfaceSet(ClientShellSurfaceSetParams),
#[serde(rename = "session.snapshot")]
SessionSnapshot(EmptyParams),
#[serde(rename = "workspace.create")]
diff --git a/src/api/schema/common.rs b/src/api/schema/common.rs
index 15f56e6c..bf0d7caf 100644
--- a/src/api/schema/common.rs
+++ b/src/api/schema/common.rs
@@ -61,6 +61,12 @@ pub struct ClientWindowTitleSetParams {
pub title: String,
}
+/// Updates whether the requesting client shell receives and controls pane presentation.
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
+pub struct ClientShellSurfaceSetParams {
+ pub active: bool,
+}
+
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum SplitDirection {
diff --git a/src/api/schema/response.rs b/src/api/schema/response.rs
index 180d6645..e6d4de4d 100644
--- a/src/api/schema/response.rs
+++ b/src/api/schema/response.rs
@@ -295,6 +295,12 @@ pub enum ResponseResult {
status: crate::config::ConfigReloadStatus,
diagnostics: Vec<String>,
},
+ /// Acknowledgement for the client-shell surface interest lease. This method is new on the
+ /// endpoint protocol, so its revision-bearing result can establish an activation floor.
+ ClientShellSurfaceSet {
+ active: bool,
+ projection_revision: u64,
+ },
Ok {},
}
diff --git a/src/api/schema/server.rs b/src/api/schema/server.rs
index 96e51564..b274bc95 100644
--- a/src/api/schema/server.rs
+++ b/src/api/schema/server.rs
@@ -21,4 +21,10 @@ pub struct ServerCapabilities {
/// Stable client-owned endpoint generation supported by this server.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub endpoint_protocol_generation: Option<u32>,
+ /// Whether this server supports explicit client-shell surface interest.
+ #[serde(default)]
+ pub surface_interest: bool,
+ /// Whether this server supports endpoint health probes.
+ #[serde(default)]
+ pub health_check: bool,
}
diff --git a/src/api/schema/tests.rs b/src/api/schema/tests.rs
index 693f0e85..b566e8f6 100644
--- a/src/api/schema/tests.rs
+++ b/src/api/schema/tests.rs
@@ -725,6 +725,8 @@ fn success_response_round_trips() {
live_handoff: true,
detached_server_daemon: true,
endpoint_protocol_generation: Some(1),
+ surface_interest: true,
+ health_check: true,
}),
},
};
diff --git a/src/api/server.rs b/src/api/server.rs
index 655d89c5..b8ef7c38 100644
--- a/src/api/server.rs
+++ b/src/api/server.rs
@@ -69,6 +69,8 @@ fn default_capabilities() -> Option<ServerCapabilities> {
live_handoff: crate::platform::capabilities().live_handoff,
detached_server_daemon: crate::platform::current_process_is_detached_server_daemon(),
endpoint_protocol_generation: Some(crate::protocol::endpoint::ENDPOINT_PROTOCOL_GENERATION),
+ surface_interest: true,
+ health_check: true,
})
}
@@ -352,6 +354,14 @@ fn handle_request(
});
}
+ if matches!(&request.method, Method::ClientShellSurfaceSet(_)) {
+ return error_response_json(
+ request.id,
+ "connection_local_only",
+ "client_shell.surface.set is only available through a client shell endpoint".into(),
+ );
+ }
+
if matches!(&request.method, Method::ServerStop(_)) {
if let Some(server_stop) = server_stop {
server_stop.store(true, Ordering::Release);
@@ -386,6 +396,7 @@ pub(crate) fn api_method_name(method: &Method) -> &'static str {
Method::CommandInvoke(_) => "command.invoke",
Method::ClientWindowTitleSet(_) => "client.window_title.set",
Method::ClientWindowTitleClear(_) => "client.window_title.clear",
+ Method::ClientShellSurfaceSet(_) => "client_shell.surface.set",
Method::SessionSnapshot(_) => "session.snapshot",
Method::WorkspaceCreate(_) => "workspace.create",
Method::WorkspaceList(_) => "workspace.list",
@@ -1136,6 +1147,8 @@ mod tests {
endpoint_protocol_generation: Some(
crate::protocol::endpoint::ENDPOINT_PROTOCOL_GENERATION,
),
+ surface_interest: true,
+ health_check: true,
}),
None,
None,