Repository navigation
Conversation
`magicinput stream` (and the Mac menu bar item "Show Front Window on <PC>") captures the front window with ScreenCaptureKit at one pixel per point, sends each new picture as a JPEG over a connection of its own (Stream instead of a hello, then Frame + Data), and plays the Pointer, Button, Wheel and Key messages coming back into the window. It runs as its own process and ends when the copy is closed or the window goes away. The PC shows the copy in a plain window of the service (decoded with zune-jpeg, drawn with StretchDIBits), brings it to the front, resizes it when the Mac window does, and sends what's done in it back. Both sides ping when idle. An ignored test (show_test_picture) streams a moving test picture to the other computer for checking the PC side. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The service now publishes the connected computer's address in its status file, and `magicinput stream` uses it instead of its own network search (which found nothing when started from the menu bar). The search stays as a fallback, with a longer wait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
betoxf
marked this pull request as ready for review
October 24, 2026 16:26
Owner
Author
|
Closing: we're not shipping window streaming for now. The branch stays in case we come back to it. |
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.
Stacked on #9 (which is stacked on #8).
What changes
Show a Mac window on the PC, and use it there. In the Mac's menu bar menu, Show Front Window on opens a live copy of the window in front on the PC (also
magicinput stream, ormagicinput stream --app Safari). Clicking, scrolling and typing in the copy happen in the real window on the Mac. Closing the copy, or Stop Showing the Window, ends it.src/stream.rs, its own process so the service stays lean): ScreenCaptureKit captures the window at one pixel per point, up to 30 frames a second, and only sends a picture when the window changes. Each picture goes over as a JPEG (quality 70) on a connection of its own (Streaminstead of a hello, thenFrame+Data). If the network falls behind, older pictures are skipped.Pointer,Button,WheelandKeycoming back are played into the window, and the app is brought forward on a click. Anything still held is let go at the end. It follows the window when it moves or resizes, and stops when the window closes.src/viewer.rs, in the service): a plain window, with pictures decoded by zune-jpeg and drawn with StretchDIBits. It comes to the front, resizes with the Mac window, and sends back what's done in it, with pointer positions in points of the Mac window. Keys held when it loses focus are released. One copy at a time.Validation
cargo test: 20 passed.cargo check --target x86_64-pc-windows-gnu: no warnings.show_test_picturetest (a moving 640x400 test picture sent from the Mac): the copy opened in front of a full-size app, and the picture rendered correctly at 150% scaling (checked by screenshot). A scripted click and the A key in the copy came back to the Mac asPointer { 320, 188.7 },Button Left down/upandKey 0x04 down/up.magicinput stream --app Calculator, started from Finder, put a live copy of Calculator in front on the PC. Typing 7, 4, 2 into the copy on the PC made the Mac's Calculator show 742, and the copy updated right away (checked by screenshot).magicinput streamgets the PC's address from the service's status file (newpeer_addr). Its own mDNS search found nothing when it was started through Launch Services.Known limits (preview)
🤖 Generated with Claude Code