Skip to content

VPS desktops: own size, sizes below 1080p, Linux clipboard, pairing fix - #26

Open
MrBeldum wants to merge 1 commit into
mainfrom
fix/vps-stream-clipboard
Open

MrBeldum wants to merge 1 commit into
mainfrom
fix/vps-stream-clipboard

Conversation

@MrBeldum

Copy link
Copy Markdown
Owner

Streaming a Linux VPS desktop (stuzha: software x264 on two cores) well, and the fixes that came out of testing it live.

What changes

  • Resolutions below 1080p: 540p, 720p, 900p. A small-CPU host's 30 fps ceiling now holds at 1080p and rises in proportion for fewer pixels, so 720p asks for 60 fps. A fixed-size desktop is only substituted when the wanted size is larger; a smaller one is honoured and scaled down.
  • Relaunch on a size change. Connecting while the Desktop still ran resumed it at the old size (a Linux prep command that resizes the desktop runs only at a launch), so a 540p stream showed a 3024×1964 desktop scaled down and captured mouse movement crawled. The Mac now relaunches the Desktop whenever it asks for a size other than the one it last launched (games are never ended for this).
  • Mouse over a shrunk fixed desktop is scaled to the desktop's pixels.
  • Pairing with Sunshine from October 2026. That engine holds POST /api/pin open until the pairing handshake ends, and the Mac only continued the handshake after Latch Host answered, so new pairings deadlocked. Latch Host now answers once the engine has taken the PIN, and answers retries for that PIN without asking the engine again.
  • VPS host work already on this branch: capture size + frame-rate ceiling in /v1/status, LATCH_DISPLAY_FOLLOWS_VIEWER, Linux engine profile, Linux clipboard shortcuts and X selection, viewer-only Mac, dist.noindex staging (the release workflow now packages from there too).
  • connect_real, an ignored live test through the window's connect path (sizes, pointer probes, typing, fps sampling).

Verified

  • cargo fmt --check, clippy -D warnings, all tests on macOS (core 51, client 82, host 92, stream 25, ui 8).
  • Live against stuzha on Sunshine 2026.1014.154843: every size relaunches and resizes the desktop (same size resumes), absolute and relative pointer land on the exact pixel at 540p/720p/900p/1080p/3024×1964, typed keys reach a terminal, 720p and 540p hold ~60 fps with scrolling text (1080p 30 fps at ~24 ms encode), and a fresh Mac identity pairs once and reuses the pairing.
  • Not verified on Windows hardware (Hermes is offline); Windows hosts on the Virtual Display Driver will list a "Repair setup" item once for the three new sizes.

🤖 Generated with Claude Code

Streaming a Linux VPS desktop (software x264 on two cores):

- Latch Host reports the X screen it captures and, for software encoding
  on fewer than four cores, a 30 fps ceiling; LATCH_DISPLAY_FOLLOWS_VIEWER=1
  stops reporting a fixed size for a desktop that resizes to each viewer.
  The Linux engine profile drops the 60 fps floor and uses superfast.
- New 540p, 720p and 900p resolutions. The host's ceiling holds at 1080p
  and rises in proportion for fewer pixels (720p gets 60 fps); a fixed
  desktop is only replaced when the wanted size is larger, and captured
  mouse movement over a shrunk fixed desktop is scaled to its pixels.
- The Mac relaunches the Desktop when it asks for a different size than
  it last launched it at; resuming kept the old desktop size, since a
  prep command runs only at a launch.
- Latch Host answers the PIN as soon as the engine has taken it: Sunshine
  from October 2026 holds the PIN post open until the handshake ends,
  which the Mac only started once Latch Host had answered.
- Clipboard with Linux: Ctrl+Insert / Shift+Delete / Shift+Insert, and
  pasted text also in the X selection.
- A Mac can be only a viewer (Share this Mac off).
- The Mac bundle is staged in dist.noindex (release workflow follows).
- connect_real: an ignored live test through the window's connect path.

Verified live against stuzha (Sunshine 2026.1014.154843): every size
relaunches and resizes correctly, absolute and relative pointer land on
the exact pixel, keys reach a terminal, 720p and 540p hold ~60 fps with
scrolling text (1080p 30), and a new Mac pairs once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant