From 0d96948c26012cc8cdaa1c76b9b3ff736e970f6e Mon Sep 17 00:00:00 2001 From: Jon Stelly <967068+jonstelly@users.noreply.github.com> Date: Fri, 6 Feb 2026 09:06:19 -0600 Subject: [PATCH] fix: remote key-up on triggered release (#371) Fixes #369 --- src/capture.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/capture.rs b/src/capture.rs index 82636fd..e4d9c8a 100644 --- a/src/capture.rs +++ b/src/capture.rs @@ -362,7 +362,13 @@ impl CaptureTask { } async fn release_capture(&mut self, capture: &mut InputCapture) -> Result<(), CaptureError> { - self.active_client.take(); + // If we have an active client, notify them we're leaving + if let Some(handle) = self.active_client.take() { + log::info!("sending Leave event to client {handle}"); + if let Err(e) = self.conn.send(ProtoEvent::Leave(0), handle).await { + log::warn!("failed to send Leave to client {handle}: {e}"); + } + } capture.release().await } }