Repository navigation
Multi-PC: the driven machine knows it, and the tray shows it without hovering - #816
Merged
Merged
Conversation
…thout hovering Tried for real on 2026-11-24 (Linux KDE master, Windows vm124 remote), the indicator of #813 had two holes: only the master's Machines page said who has the mouse and keyboard, and the tray said it in a tooltip, which can only be read with the pointer on the master — never while it is elsewhere. - The remote follows its master's stream: `forward` tells the manager when an `Enter` reaches the hook and when a `Leave`, a session ended here or the end of the link takes the pointer away. `PeersState::driven_by` and `Snapshot::DrivenBy` (additive) carry it; the Machines page says "Driven by <master>" and marks the master "Drives this machine". - The tray icon changes on the crossing, nothing polled: faded on a master whose pointer went to another machine, a magenta dot on the machine a master drives. Painted into the icon's pixels, so that every StatusNotifierItem host and the Windows notification area show it alike. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mgth
commented
Nov 24, 2026
mgth
left a comment
Owner
Author
There was a problem hiding this comment.
Le test d’intégration avec un maître passe. J’ai reproduit un badge périmé avec deux maîtres appairés sur des connexions locales.
…ne driving Review of #816: the remote's masters share its one connection to the hook. One going closes it, so that the hook releases what it left pressed, which ends the session of the master driving at that moment too; that one was never told, and DrivenBy went on naming it. A release now counts as a loss of everything written on the connection: the driving master's link resets its session, clears DrivenBy and says InputReset, which brings that master's pointer home. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/mpc-driven-indicator # Conflicts: # docs/multi-pc-etat.md # rust/crates/lbm-agent/src/api.rs
mgth
commented
Nov 24, 2026
mgth
left a comment
Owner
Author
There was a problem hiding this comment.
Contrôle après intégration de v6 sur c4e3c430. La résolution dans Snapshot conserve DrivenBy et InputSharing. J’ai relancé le scénario à deux maîtres. Après la déconnexion de B, le hook se ferme, driven_by se vide et A reçoit InputReset. Le correctif précédent tient après fusion.
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.
Follow-up to #813, from the maintainer's real trial on 2026-11-24 (master: Linux KDE; remote: Windows vm124). Two defects:
What changes
Remote side (
lbm-agent/src/peers/actor.rs): the link'sforwardtask already sees the master's batches go to the hook. It now tells the manager when the master's stream crosses in and when it leaves (Internal::Driving):Enterthat reaches the hook → driven by that master;Leave, a session ended here (full queue, hook lost input →InputReset), or the end of the link → no longer driven. The end of the stream counts as aLeave.Only the link that drives can clear it, so a second master's
Leavedoes not clear the first one's. The state carries it asPeersState::driven_by(machine id) andSnapshot::DrivenBy(name). Both are additive (#[serde(default)]), so an older agent's state means "nobody".Machines page (
lbm-ui,lbm-app): the remote shows "Driven by : its mouse and keyboard are on this machine", and the master's row gets "Drives this machine". Being driven never rebuilds the map.Tray icon (
icons.rs,tray/): a newBadgesits on top of the engine state. The icon changes when the state changes at a crossing; nothing is polled.The badge is painted into the icon's own pixels, for both the StatusNotifierItem pixmaps and the Windows
HICONs (12 icons are made up front instead of 4). Alternatives considered:OverlayIconPixmap: not every host draws it, and the Windows notification area has nothing like it;Status::NeedsAttention: it means an alert, and some hosts make it blink.ksni already sends
NewIconwhen the pixmap changes. The tooltip also says "driven by ".docs/multi-pc-etat.mdis updated.Tests
tests/peers.rs::the_remotes_state_says_which_master_drives_it: a test master linked to a real manager. Motion before any crossing → nobody;Enter→driven_by= master;Leave→ none;Enteragain then the link closes with noLeave→ none.DrivenMachine/DrivenByfor every engine state, and Away wins when both are set. On Linux, the SNI pixmaps carry the badge. On Windows, every state and badge has its own icon index.icons.rs: no badge gives the plain icon; Away keeps the colour and lowers the alpha; Driven puts the dot at its centre on every size and state and leaves the rest of the icon untouched.input_goes_tofor a driven machine, a kittest of the page, and the app reader forDrivenBy.cargo clippy --workspace --all-targetsis clean on Linux and forx86_64-pc-windows-gnu.Locally, the 10 inotify tests (
watch,wallpaper_watch) fail withENOSPC: this machine has no inotify watches left. Nothing in this PR touches them.Never run on real hardware
🤖 Generated with Claude Code