Repository navigation
Multi-PC: drag the rulers on the remote's screens - #840
Conversation
The rulers a master shows on a remote (#817) were passive there: aligning meant dragging those on the master's own screens. They can now be dragged where they are. - lbm-overlay: Standalone::interactive takes the pointer and hands every gesture to a callback, from the overlay thread (Windows: after each dispatched message; Linux: the helper's reader wakes the thread, which renews the lease once per pulse only). - Wire: Overlay gains Interactive (default false: an older remote draws them passive), and OverlayInput { Revision, Input } goes back, in order, from a bounded queue, to the master whose rulers are shown only. - Agent: the master hands an OverlayInput to the frontend that showed those rulers alone (event PeerOverlayInput, capability PeerOverlayInput), only while it asks for them interactive and for a revision it sent. - lbm-app: asks Interactive when the agent offers it; takes a gesture only on a band it sent to that machine and still shows, and feeds it to screen_input like its own screens' (drag moves the monitor, wheel scales, Escape hides). - peer_drive gains `dragrulers N` and prints the gestures. - docs/multi-pc.md: conflict markers left by an earlier merge removed, both sides kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mgth
left a comment
There was a problem hiding this comment.
Le test du déplacement d’un écran depuis sa règle distante passe en local. Deux cas restent à couvrir sur un lien chargé ou retardé.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…input # Conflicts: # rust/crates/lbm-agent/src/api.rs
mgth
left a comment
There was a problem hiding this comment.
Le compte rendu ajouté décrit un glisser de 400 pixels sur vm124 dont le maître a reçu le Release. J’ai revérifié les deux cas limites sur cbdf31f6, après l’intégration de v6. Sur une file pleine, try_send peut encore perdre le Release qui valide le déplacement. Après fermeture et réouverture des règles, le filtre revision <= sent accepte encore un événement retardé de la session précédente. Les deux discussions restent ouvertes.
…late one Review of #840: - The gestures waited in a bounded channel whose try_send could drop the Release that commits a drag, leaving the master's preview pending until the next press. They now wait in overlay::Gestures: a move following a move on the same band replaces it, and nothing else is merged or dropped short of 1024 waiting. One task sends them in order, then what is left once the surfaces are gone. - `revision <= sent` let a late gesture from rulers since closed commit a drag of those reopened on the same band. The master's agent now keeps, per remote, the revision the current interactive showing began with (rulers on, made draggable, or sent again on a new link) and takes only gestures from it on. Tests: moves merge and the release survives a lagging link; a stalled link keeps the oldest; a Release made under rulers since closed is dropped, those of the reopened showing, before and after an update, are taken. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…input # Conflicts: # docs/multi-pc-etat.md
mgth
left a comment
There was a problem hiding this comment.
Le test du relâchement tardif après fermeture et réouverture des règles passe sur f3d29e46 : la borne inférieure de révision écarte l’ancienne session. Le test du glisser ordinaire passe aussi. Il reste une perte de Release dans l’interface maître lorsque sa file atteint 1 024 événements. J’ai reproduit le cas dans le test de l’éditeur et ajouté les résultats à la discussion sur la fin du glisser.
…cels Review of #840 (f3d29e4): the master window held the remote's gestures in a Vec capped at 1024 until the next frame, so a Press, 1023 Moves and a Release arriving together lost the Release and left the drag pending; the remote's queue could do the same with 1024 gestures that cannot merge. Both stages now share lbm_overlay::input::Gestures (moved from the agent): moves merge, nothing else is dropped, and a queue that fills all the same gives up what waits for a Cancel, which ends the gesture under way rather than leave it open. Tests: the window test now delivers Press, 1023 Moves and Release before a frame and checks the monitor moved and no drag is left; an overflow of presses and releases leaves none either; the queue's own tests moved to lbm-overlay with the cancel case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…input # Conflicts: # docs/multi-pc.md
mgth
left a comment
There was a problem hiding this comment.
Le cas reproduit à la revue précédente est corrigé dans f0d0b6dc. J’ai relancé le test de l’éditeur avec un appui, 1 023 mouvements, puis le relâchement avant la frame suivante. Le panneau atteint la position attendue et le glisser se termine. L’agent et l’éditeur utilisent désormais la même file : elle regroupe les mouvements consécutifs et émet Cancel si des événements non regroupables la saturent. Les tests de saturation et de rejet d’un événement retardé après réouverture passent aussi. La dernière remarque est traitée.
…/mpc-remote-rulers-input # Conflicts: # rust/crates/lbm-agent/src/peers/actor.rs
The maintainer asked that the rulers on a remote's screens be handled there as they are on the master's own. Until now (#817) they were passive on the remote: aligning meant dragging those on the master's screens.
How it works
The remote edits nothing. The master's window stays the layout's only editor.
lbm-overlay::Standalone::interactive,lbm-agent/src/peers/actor.rs): asked withOverlay { Interactive: true }, it draws the rulers taking the pointer (the master's, injected there) and the keyboard. Every gesture goes back to the master whose rulers they are, in order, asOverlayInput { Revision, Input }: press, move, release, wheel, Escape.OverlayInputto the frontend that showed those rulers, and to no other (PeerOverlayInputevent). It does so only while that frontend asks for them interactive, and only for a revision it sent.remote_rulers::gesture,screen_overlay_input): it asks forInteractivewhen the agent announcesPeerOverlayInput. It takes a gesture only on a band it sent to that machine and still shows, then runs it throughscreen_inputexactly like its own screens' gestures: a drag moves that screen's monitor, the wheel scales it, Escape hides the rulers.Interactiveand draws passive rulers. An older agent never announces the capability, so the window asks for nothing new.Also
docs/multi-pc.mdonv6still held two sets of conflict markers from an earlier merge: the clipboard section against "Rulers on a remote's screens", and the wire list. This PR removes them and keeps both sides, since it edits those very sections.examples/peer_drivegainsdragrulers Nand prints the gestures it receives.Tests
lbm-net: round-trip ofOverlay { Interactive }andOverlayInput.lbm-agent/tests/peers.rs:lbm-agent/tests/api.rs: the gesture reaches the window that showed the rulers, unread. It is not sent to another window, nor for a revision never sent, nor once the rulers are passive again.lbm-app:Interactiveis asked only with the capability;cargo clippy --workspace --all-targets: clean.lbm-agentandlbm-hookforx86_64-pc-windows-gnu: clean.lbm-agent,lbm-app,lbm-net,lbm-overlay,lbm-ipcandlbm-hook: 1030 pass. Not run: the inotify tests (this machine is out of inotify instances), andsupervise, which fails here as before because a real hook is running.Tried on real hardware
Windows remote, vm124 (4K at 1.5 + 1080p).
peer_drive dragrulers 0on the Linux machine played the master, andpeer_remote(MSVC release) the remote, next to the maintainer's installed agent, which was not touched. Gestures were injected into the VM's session withSetCursorPos,mouse_eventandkeybd_event.WindowFromPointon the top ruler returnsLittleBigMouse.ScreenOverlay.v7(with passive rulers it returned the desktop beneath, feat(multi-pc): rulers on the remote's screens #817).OverlayInputunder revision 1.atis in points: the press came at 666.7 of 2560, the release at 933.3, which is 1000 px and 1400 px at scale 1.5.C:\temp\mpc-rulersremoved. The build reused the VM's existing target folder: C: went from 2.6 GB to 2.2 GB free.Never run on real hardware
lbm-appon a real master applying those gestures to the layout: covered by tests only.peer_driveprints the gestures but edits nothing.Independent of #838 (the toggle being available when a remote's screen is selected). Both edit the same "Faiblesses connues" line of
docs/multi-pc-etat.md; whichever merges second will mergev6first.🤖 Generated with Claude Code