Repository navigation
feat(multi-pc): rulers on the remote's screens - #817
Conversation
The master's editor computes each remote screen's rulers from its layout, in millimetres and in that remote's own pixels, and sends them through its agent (PeerOverlay -> Control::Overlay, capability RemoteOverlay). The remote checks every band against its screens as they are now and draws them, passive, with lbm_overlay::Standalone on surfaces that exist only while shown. They go with the link, the master's frontend, the mode, or a display change; a failure comes back as OverlayFailed / OverlayError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… node alone peer_drive gains 'rulers N' (computed from the remote's Displays by the master's own scene code) and 'norulers', and prints OverlayFailed while it sleeps. peer_remote runs the agent's multi-PC manager with real overlays and no hook, beside a user's running agent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A remote's OverlayFailed for a revision the master has since replaced is old news and no longer shows. lbm-app shows no computed error when the agent cannot send rulers at all. Docs: 'Rulers on a remote's screens' in multi-pc.md, and the state of the work (delivered, tried on vm124 and in a nested KWin, never tried) in multi-pc-etat.md. Drops a trial example committed by mistake. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mgth
left a comment
There was a problem hiding this comment.
Les trois tests d’intégration ciblés sur les règles distantes passent. Un test avec deux connexions à l’API reproduit un effacement par l’ancien éditeur.
Review: window A turning its rulers off sent an empty Overlay to a remote whose rulers window B, still open, had replaced since; B keeps its scene cached and would not resend it. Each remote now records the client that wrote its rulers last; only that client's empty request or departure takes them down. Test with two API connections. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/mpc-remote-rulers # Conflicts: # docs/multi-pc-etat.md
mgth
left a comment
There was a problem hiding this comment.
Contrôle après intégration de v6 sur 75b7192c. Les trois tests d’API sur les règles passent. Quand B remplace les règles de A, leur affichage survit à la demande d’effacement et à la déconnexion de A. B peut toujours les retirer. La résolution du conflit documentaire conserve les deux fonctionnalités.
…/mpc-remote-rulers # Conflicts: # docs/multi-pc-etat.md
…/mpc-remote-rulers # Conflicts: # rust/crates/lbm-agent/examples/peer_drive.rs # rust/crates/lbm-agent/src/peers/actor.rs # rust/crates/lbm-agent/src/peers/mod.rs # rust/crates/lbm-agent/tests/peers.rs # rust/crates/lbm-net/src/wire.rs
mgth
left a comment
There was a problem hiding this comment.
Recontrôlé après l’intégration de v6 et de #818 sur 40385b04. Les trois tests d’API sur les règles distantes passent, dont le remplacement des règles de A par B puis la déconnexion de A. Le gestionnaire conserve aussi le traitement des blocages Windows. La CI est verte.
In multi-PC mode, "Rulers on screens" (Location mode) now draws the rulers on the remote's screens too. Each ruler sits at its own place and its physical size, as on the master's screens. Until now only the master's own screens got them.
How it works
lbm-app/src/remote_rulers.rs). For each remote on the map, it takes the layout with every other machine's sources off their desktop and runs the samelbm_overlay::scene::from_layoutit uses for its own screens. The millimetres come from the master: where the zero falls, the measured panel's length, each screen's physical size. The pixels, the scale and the output name come from what the remote reported inDisplays. A set is sent only when it changes (a drag sends one per redraw, a still layout sends none).PeerOverlay { MachineId, Bands }(capabilityPeerOverlay). The frontend that asked owns the rulers: when its connection ends, the agent takes them down on every remote.OverlayErroron the remote's entry inPeerssays why a remote does not show them. The window shows that message under the toggle.Control::Overlay { Revision, Bands }(master → remote, empty takes them down) andControl::OverlayFailed { Revision, Error }(remote → master). They are sent only to a remote whoseHellolistsRemoteOverlay. An older remote is sent nothing, and the master's user is told it cannot show rulers. A higher revision wins. A failure of an earlier revision is not shown.lbm-agent/src/peers/overlay.rs). Every band must be a ruler on one of its attached screens as they are now (same output, same pixel rectangle, same scale). Otherwise the whole set is refused, so a master working from an older report cannot draw across the wrong place. They are drawn by the newlbm_overlay::Standalone, and they are passive (newBand::passive): the pointer and the keyboard go through them. Rulers are still dragged on the master's own screens.--screen-overlay-host, aslbm-appdoes). The helper has a two-second lease, so the thread renews it every 500 ms, only while rulers are shown.Displays). A display change seen by the surfaces themselves takes them down too. The thread and the surfaces exist only while something is shown. Nothing runs while the mode is off.Tools
examples/peer_drivegainsrulers N(computed from the remote'sDisplaysby the master's own scene code) andnorulers. It printsOverlayFailedwhile it sleeps.examples/peer_remoteruns the agent's multi-PC manager alone, with real rulers and no hook. It holds no instance lock, so it can run beside a user's running agent on another port.Tests
lbm-net: wire round-trip ofOverlay/OverlayFailed; emptyBandsmay be left out.lbm-agentunit: what the remote accepts (screens as they are; a moved, unplugged, detached or rescaled screen; non-ruler content; out-of-screen rect; unreadable band; more than 64 bands).lbm-agent/tests/peers.rs, with a recording painter instead of real surfaces:OverlayFailed, taken down when the link drops;lbm-agent/tests/api.rs:PeerOverlayis passed on unread and taken down when the frontend's connection ends; a remote without the capability is sent nothing andOverlayErrorsays so.lbm-app: the remote's bands come in its own pixels and measure the selected panel; a remote off its desktop gets none; only changes are sent; turning off empties every remote; an agent without the capability is never asked; errors are shown.cargo clippy --workspace --all-targetsclean;lbm-hookandlbm-agent(all targets, examples included) clean forx86_64-pc-windows-gnu.Tried on real hardware
peer_driveon the Linux machine played the master;peer_remote(MSVC release) was the remote, next to the maintainer's installed agent, which kept running untouched. Results:rulers 0thenrulers 1), and the update worked;norulersand when the master was killed (kill -9);WindowFromPointon a ruler returns the desktop beneath.Standalonedrew, updated and renewed its lease inside a nested headless KWin (kwin_wayland --virtual, layer-shell), and the helper process was gone afterwards. This was not tried on a real desktop.Never run on real hardware
lbm-appon a real master (the window's computation and itsPeerOverlayrequests). It is covered by tests only; only thepeer_drive→ remote path ran.Known limits
docs/multi-pc.mdgains "Rulers on a remote's screens".docs/multi-pc-etat.mdis updated (delivered, tried, never tried, work in progress).🤖 Generated with Claude Code