Skip to content

Fix: IPC frame send failure kills session when GPU renderer is active #21

@CREVIOS

Description

@CREVIOS

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

Files to modify

  • `src-tauri/src/rdp/session.rs` — conditional IPC send

Priority: P1 — prevents false disconnections

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggpuGPU rendering pipeline

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions