Repository navigation
View and control Linux desktops from the iPhone (851-4486) - #1493
Merged
pondorasti merged 13 commits intoNov 26, 2026
Merged
Conversation
The iPhone answered "can only be viewed from a Mac" for a Linux desktop. The VNC viewing session, frame publishing and input translation now build for iOS, the WebSocket transport moves to the shared connection package, and the phone's Desktop pane opens the server's relay like the Mac does. The phone has no keyboard layout to read, so key codes go through a fixed US table. It draws no cursor, so it asks the server to paint the pointer into the picture. It never resizes the desktop. Touch scrolling turns the wheel by the distance dragged instead of once per movement. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…lling Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Pasted Windows line endings pressed Return twice. A hardware keyboard with a non-US layout typed its US positions, so its keys now go as the characters iOS reports for them. A control grant that arrived after the phone gave up was kept by the machine; the phone now hands it back. The fixed key table no longer claims to handle Caps Lock, which the phone never sent. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…oll's leftover with its gesture Shift tapped in the on-screen bar was dropped for hardware keys, because iOS reports the key without it. Option on a non-US layout sent Alt and the key's letter instead of the character the layout makes (German Option-L is @). A dead key fell back to its US position and typed a character nobody pressed; it now sends nothing, and the next key carries what iOS made of the two. The distance left over from a two-finger scroll is forgotten after 300 ms without scrolling. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…t on a Linux desktop The delta review found that Option-Space typed a non-breaking space, an Option dead key was sent as Alt and the letter, a shortcut on a key iOS gives no character for was dropped, and Shift tapped on screen guessed a US shifted symbol for non-letter keys (and turned ß into SS). Co-Authored-By: Claude Fable 5.2 <[email protected]>
…when a drag begins A shortcut on a character outside the US table's unshifted keys is sent as its own keysym with every held modifier, so Shift is neither lost (Command-Shift-§), doubled into two letters (ß), nor invented (French Command-&). A dead key sends nothing whatever is latched on screen. The touch scroll's leftover distance is dropped when the next two-finger drag begins instead of after a pause. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…wn limits A character key with unprintable characters goes by position instead of vanishing; only an empty report is a dead key. Caps Lock no longer adds Shift to a shortcut. On-screen Shift capitalises only characters whose capital is that same letter (µ stays µ). A new scroll gesture also drops the phone's own sub-pixel remainder. Co-Authored-By: Claude Fable 5.2 <[email protected]>
… a capital whose small form is two code points Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ey when it reports another space Co-Authored-By: Claude Fable 5.2 <[email protected]>
… invisible characters are handled Co-Authored-By: Claude Fable 5.2 <[email protected]>
…lt otherwise Option alone typed whatever the layout composed, which on a US keyboard is nearly every letter, so Alt shortcuts from a hardware keyboard were lost. It now types the composed character only when it is ASCII or a currency sign (German @ [ | \ and €, US £); any other result is Alt with the key's own letter again. Co-Authored-By: Claude Fable 5.2 <[email protected]>
pondorasti
deleted the
alexandru/851-4486-linux-desktop-step-5-view-and-control
branch
November 26, 2026 23:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes 851-4486
Part of 851-4479
The iPhone can now view and control a Linux machine's desktop, in the same Desktop tab it has for Macs. Before, it said "can only be viewed from a Mac".
What changed
ScreenSharing/VNC) build for iOS. They used nothing Mac-specific; only the#if os(macOS)gates go.RFBWebSocketTransportmoves fromCodevisorCoreMactoScreenSharingConnection, so both apps use it. The Mac's wiring is unchanged.ScreenSharingDesktopsgives each machine a VNC transport that opens the server's relay socket. Connecting, failing, retrying, reconnecting and "in use on another device" are the shared connection's, as for a Mac.VNCUnitedStatesKeyLayout). Command goes out as Control, as on the Mac.serverDrawsPointer, which leaves the cursor-shape and pointer-position encodings out of what the client advertises, so the VNC server paints the pointer into the picture.VNCScrollInput.touch: one click per 20 desktop pixels dragged.VNCScreenSharingSession.initwas 73 lines and baselined in SwiftLint; its receive loop is now a small static function and the baseline entry is gone.Left out, as decided
Resizing the desktop to the phone, the 2x switch, clipboard sync (Paste from iPhone stays), cursor shapes, and setting up a desktop from the phone.
The "set up a desktop" line for a machine without one is left out. Neither thing it would point to exists yet (
codevisor desktop setupis step 2, the Mac app's button is step 4), and a machine without a desktop doesn't offer Open Desktop at all, so the line would need a new dead-end row on every Linux machine. It belongs with step 2 or 4.Tests
New, and failing without the change (checked by breaking the code: 6 of them fail when the pointer, name, scroll or key table choices are removed):
ScreenSharingLinuxDesktopTests: the phone's real pane model against a real RFB server through a fake relay socket. Goes live with no host start and no resize; a tap asks for control under the phone's name and clicks once granted; another device taking control leaves the picture and says who; right-click; drag; slow scroll; typing with Command as Control; every printable key; a refused relay fails with Try Again and Try Again connects; a dropped relay reconnects.VNCUnitedStatesKeyLayoutTests,VNCWheelTests, and a cursor test forserverDrawsPointer.RFBWebSocketTransportTestsmoves with the transport, and the VNC transport tests (including step 1's remembered-display test) now run ungated.193 tests in 24 touched suites pass.
build:iosandbuild:macossucceed.Code review (medium)
Found six things. Fixed, each with a test:
Left:
Hardware keyboards on a Linux desktop (after review at 35a68af)
A hardware keyboard's key codes are positions and its layout may not be US, so for a Linux desktop the phone sends what iOS reports for the key (
ScreenSharingHardwareKey, rules in the ScreenSharing README):charactersand "´" as its unmodified character; the next key reports "é", "´" after Space, or "´x" when the two don't combine. Option and Shift-Option reports were measured once (Shift-Option-7 gave "\" over "7"); Control, Command and Caps Lock reports were not measured.scrollGestureBegan), along with the phone's sub-pixel remainder.Known limits, listed in the README: an Option combination that iOS reports no character for is treated as a dead key; a shortcut with Shift on a digit or punctuation key sends the US shifted symbol; a pending accent is dropped if the next key is a shortcut or has no character; Space reporting another kind of space arrives as an ordinary space.
The code review ran on this delta six times. Every pass found further layout cases in this logic; the concrete ones are fixed with tests, and what is left is the list above. The last commit (the narrower Option rule) was not reviewed by the skill.
Checked by hand
iOS 27.2 simulator (iPhone 17 Pro) against the dev container's Xfce desktop (
CODEVISOR_DEV_CONTAINER_DESKTOP=1), on the code before the rebase onto step 1 (#1485) and again after it:echo "Hi_iPhone-42!" ~ $HOME | tr a-z A-Zarrived intact, the on-screen keys work, and Command with c interruptedsleep 100(arrived as Control-C).Not checked by hand (this Mac's screen was locked, so the simulator window could not be driven with two fingers, and the later fixes were not run in the simulator against a Linux desktop):
ScreenSharingLinuxDesktopTests, down to the bytes sent to the VNC server, and byVNCWheelTests.ScreenSharingHardwareKeyTestsand three model-level tests against a real RFB server. What iOS reports for keys was measured in the simulator on a German layout; the rules were not typed into a Linux desktop by hand. Before these rules, hardware-style keys on a US layout were checked by hand (a, Shift+Z, 9, Shift+!).Screenshots
Also: another device took control, typing in a terminal.
🤖 Generated with Claude Code