Skip to content

Feat/linked host switching - #479

Merged
davidbudnick merged 18 commits into
AprilNEA:masterfrom
LCozatl:feat/linked-host-switching
Aug 10, 2026
Merged

Feat/linked host switching#479
davidbudnick merged 18 commits into
AprilNEA:masterfrom
LCozatl:feat/linked-host-switching

Conversation

@LCozatl

@LCozatl LCozatl commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Add keyboard-initiated Easy-Switch synchronization for linked Logitech pointing devices.

When an Easy-Switch key is pressed on a compatible keyboard, OpenLogi switches every configured pointing device to the corresponding host channel before switching the keyboard. This allows the
configured devices to move together between hosts.

Implementing this feature also exposed a HID++ capture lifecycle issue: a device returning after an Easy-Switch transition retained its route but did not restart capture. The capture target now
follows the device's online state without resetting its DPI-cycle position.

Changes

  • openlogi-core

    • Add host_switch_targets to the per-device TOML configuration.
    • Support serialization and deserialization of physical target device keys.
  • openlogi-hid

    • Detect host-switch controls exposed through HID++ reprogrammable controls.
    • Support diverted-control and analytics-event reporting modes.
    • Switch configured pointing devices before switching the initiating keyboard.
    • Reuse the receiver channel when linked devices share a Bolt or Unifying receiver.
    • Restore temporarily modified control reporting when the session ends.
  • openlogi-agent-core

    • Resolve configured host-switch links against the current device inventory.
    • Rebuild links when the configuration or device availability changes.
    • Require the initiating keyboard to be online while preserving routes for sleeping target devices.
    • Restart HID++ capture when a device returns without resetting its DPI-cycle position.
    • Ignore missing targets and empty link configurations.
    • Add coverage for host-switch links and capture lifecycle transitions.
  • Documentation

    • Document host_switch_targets and provide a TOML configuration example.

Testing

Automated verification:

  • devenv tasks run openlogi:check

OpenLogi hardware testing was performed on Linux using the OpenLogi 0.6.22 RPM package with:

  • MX Master 3S, firmware 22.1.6, linked to an MX Mechanical, firmware 71.3.21.
  • MX Master 3S, firmware 22.1.6, linked to an MX Mechanical Mini, firmware 72.3.14.

Both combinations were tested with the new host-switch synchronization functionality.

Cross-agent behavior was additionally checked using the official Logi Options+ 2.5 client:

  • Windows with a Bolt receiver.
  • macOS over Bluetooth.

These checks confirmed that the devices can switch between corresponding host channels regardless of which agent manages them. OpenLogi itself was not runtime-tested on Windows or macOS as part
of this change.

Known limitations

  • Older keyboard firmware may not expose the HID++ controls or events required by this feature.
  • Every linked device must already be paired with the corresponding channel on each host.
  • The host-switch link must be configured on every computer from which the keyboard can initiate a switch.

Note

Depends on #453 for the online-aware input capture selection behavior. This branch will be rebased onto master after that PR merges, then re-tested before being marked ready for review.

Comment thread crates/openlogi-hid/src/host_switch.rs Outdated
Comment thread crates/openlogi-agent/src/main.rs Outdated
Comment thread crates/openlogi-agent-core/src/watchers/host_switch.rs Outdated
@greptile-apps

greptile-apps Bot commented Jul 29, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds synchronized Easy-Switch handling for linked pointing devices and updates receiver arbitration, channel reuse, configuration, and capture lifecycle behavior.

  • Adds persistent keyboard-to-pointing-device host-switch links.
  • Detects and temporarily configures HID++ host controls.
  • Coordinates linked host transitions with pairing, capture, and ordinary device I/O.
  • Restarts capture as the selected device moves offline and online.

Confidence Score: 4/5

The PR does not yet appear safe to merge because valid host-key requests can still be discarded and concurrent receiver sessions can still split HID++ reports.

Session reconciliation removes generation state before queued key-press completions are consumed, while gesture capture and host switching continue to use independent channel stores under simultaneous shared receiver leases.

Files Needing Attention: crates/openlogi-agent-core/src/watchers/host_switch.rs, crates/openlogi-agent-core/src/receiver_access.rs, crates/openlogi-hid/src/channel_pool.rs

Important Files Changed

Filename Overview
crates/openlogi-agent-core/src/watchers/host_switch.rs Adds generation-tagged host-switch session reconciliation and coordinated transitions.
crates/openlogi-agent-core/src/receiver_access.rs Replaces exclusive capture ownership with shared session leases and reason-tagged exclusive operations.
crates/openlogi-hid/src/host_switch.rs Implements host-control discovery, rollback-safe temporary reporting changes, event capture, and ordered device switching.
crates/openlogi-hid/src/channel_pool.rs Adds transport-based channel reuse for host-switch sessions.
crates/openlogi-agent-core/src/orchestrator.rs Resolves configured host-switch links and synchronizes capture targets with online state.
crates/openlogi-core/src/config/device.rs Adds backward-compatible serialization of per-device host-switch targets.

Reviews (6): Last reviewed commit: "style: rustfmt after host-switch rebase" | Re-trigger Greptile

@LCozatl
LCozatl marked this pull request as draft July 29, 2026 04:03
@davidbudnick davidbudnick added type: feature New feature request platform: all Cross-platform issue labels Aug 2, 2026
@LCozatl
LCozatl force-pushed the feat/linked-host-switching branch from b3694b8 to 762ec45 Compare August 4, 2026 21:50
@LCozatl

LCozatl commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai

@LCozatl
LCozatl marked this pull request as ready for review August 5, 2026 03:45
Comment thread crates/openlogi-agent-core/src/watchers/host_switch.rs
@LCozatl
LCozatl marked this pull request as draft August 5, 2026 04:03
@davidbudnick
davidbudnick force-pushed the feat/linked-host-switching branch from 762ec45 to 97c329a Compare August 10, 2026 00:02
@davidbudnick
davidbudnick marked this pull request as ready for review August 10, 2026 00:17
Comment thread crates/openlogi-agent-core/src/receiver_access.rs
@davidbudnick
davidbudnick force-pushed the feat/linked-host-switching branch from 97c329a to 0c7564a Compare August 10, 2026 00:21
LCozatl added 16 commits August 9, 2026 19:32
  - add keyboard-initiated host-switch session handling
  - switch configured pointing devices before the keyboard leaves the host
  - resolve configured host-switch targets through the agent inventory
  - keep sessions synchronized with device availability changes
  - add TOML configuration and tests for host-switch targets
  - add shared runtime storage for resolved host-switch links
  - rebuild links when configuration or device inventory changes
  - require the initiating keyboard to be online
  - preserve routes for sleeping linked target devices
  - ignore missing targets and empty link configurations
  - add coverage for online keyboard and sleeping target behavior
Handle poisoned DPI cycle locks explicitly in the online-state test so the
workspace passes Clippy with unwrap_used denied.
@davidbudnick
davidbudnick force-pushed the feat/linked-host-switching branch from 0c7564a to 3e09ead Compare August 10, 2026 00:33
@davidbudnick
davidbudnick merged commit ce8e7fc into AprilNEA:master Aug 10, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: all Cross-platform issue type: feature New feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants