-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem
In `session.rs`, the IPC frame path runs ALWAYS — even when the GPU renderer is active and handling display. If the IPC channel closes or errors, `send_frame_packet()` returns `Err` and the session disconnects with `DisconnectReason::ConnectionLost`.
This is wrong: when the GPU renderer is the primary display path, IPC frame failures should be silently ignored (the user is seeing frames via GPU).
Current code (session.rs ~line 583)
```rust
// Always send via IPC — webview Canvas renders these
let packet = encode_image_update_packet(...);
if self.send_frame_packet(packet).is_err() {
return DisconnectReason::ConnectionLost; // ← KILLS SESSION
}
```
Fix
```rust
if self.shared_frame.is_some() {
// GPU renderer is primary — IPC is optional, don't kill session on failure
let _ = self.send_frame_packet(packet);
} else {
// IPC is the only display path — failure is fatal
if self.send_frame_packet(packet).is_err() {
return DisconnectReason::ConnectionLost;
}
}
```
Or even better: skip IPC entirely when GPU is active to save CPU:
```rust
if self.shared_frame.is_none() {
let packet = encode_image_update_packet(...);
if self.send_frame_packet(packet).is_err() {
return DisconnectReason::ConnectionLost;
}
}
```
This requires issue #14 (transparent webview) to be implemented first, otherwise the screen is black.
Depends on
- Make wgpu GPU-rendered frames visible via transparent webview overlay #14 (transparent webview overlay)
Files to modify
- `src-tauri/src/rdp/session.rs` — conditional IPC send