aboutsummaryrefslogtreecommitdiff
path: root/src/client/mod.rs
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-16 15:16:45 +0300
committerGitHub <noreply@github.com>2026-09-16 15:16:45 +0300
commitd1a53b2c0e7a365c20a524d75906ae83c6094458 (patch)
tree867b7ffb30c70d60ddad3b20975550dda21ca96f /src/client/mod.rs
parent18061191fdc019498610aee81f0df93f6c2ebd31 (diff)
fix: keep local usable when remote machines stall (#4234)
refs #3903
Diffstat (limited to 'src/client/mod.rs')
-rw-r--r--src/client/mod.rs29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/client/mod.rs b/src/client/mod.rs
index 9fff9719..cb465096 100644
--- a/src/client/mod.rs
+++ b/src/client/mod.rs
@@ -414,6 +414,7 @@ async fn run_client_loop(
redraw_on_focus_gained: config.redraw_on_focus_gained,
repaint_pending: false,
presentation_frozen: false,
+ deferred_local_activation: None,
draw_host_cursor,
detached_process_children: Vec::new(),
shell: config.shell_config.map(shell::ClientShellState::new),
@@ -819,7 +820,7 @@ async fn run_client_loop(
&mut pending_activation,
&mut endpoint_commands,
&mut prefix_input_source,
- &event_tx,
+ &mut scheduled_activation,
)? {
return Ok(());
}
@@ -983,7 +984,7 @@ async fn run_client_loop(
&mut pending_activation,
&mut endpoint_commands,
&mut prefix_input_source,
- &event_tx,
+ &mut scheduled_activation,
)? {
return Ok(());
}
@@ -1087,7 +1088,7 @@ async fn run_client_loop(
&mut pending_activation,
&mut endpoint_commands,
&mut prefix_input_source,
- &event_tx,
+ &mut scheduled_activation,
)? {
return Ok(());
}
@@ -1263,7 +1264,7 @@ async fn run_client_loop(
target,
force,
now,
- &event_tx,
+ &mut scheduled_activation,
)?;
}
ClientLoopEvent::ServerMessage {
@@ -1744,7 +1745,7 @@ async fn run_client_loop(
&mut write_stream,
state.shell.as_mut(),
&mut state.detached_process_children,
- &event_tx,
+ &mut scheduled_activation,
)?;
let repaint = repaint || dispatch_repaint;
if replay_mouse.is_empty() {
@@ -1776,7 +1777,7 @@ async fn run_client_loop(
&mut pending_activation,
&mut endpoint_commands,
&mut prefix_input_source,
- &event_tx,
+ &mut scheduled_activation,
)? {
return Ok(());
}
@@ -1962,6 +1963,14 @@ async fn run_client_loop(
}
}
write_stream.mark_ready(&endpoint_id, generation);
+ if endpoint_id.is_local() {
+ if let Some(event) =
+ take_ready_local_activation(&mut state, &write_stream)
+ {
+ scheduled_activation = Some(event);
+ continue;
+ }
+ }
let selected_endpoint = endpoint_catalog
.selected_profile
.as_ref()
@@ -1978,7 +1987,11 @@ async fn run_client_loop(
let needs_surface = write_stream
.connection(&selected_endpoint)
.is_some_and(|connection| !connection.surface_active);
- if activation_ready && needs_surface && pending_activation.is_none() {
+ if activation_ready
+ && needs_surface
+ && pending_activation.is_none()
+ && state.deferred_local_activation.is_none()
+ {
scheduled_activation = Some(ClientLoopEvent::ActivateEndpoint {
endpoint_id: selected_endpoint,
target: None,
@@ -2113,7 +2126,7 @@ async fn run_client_loop(
&mut pending_activation,
&mut endpoint_commands,
&mut prefix_input_source,
- &event_tx,
+ &mut scheduled_activation,
)? {
return Ok(());
}