feat(core): seed Finder/Safari navigation profiles for pointing devices - #1351
feat(core): seed Finder/Safari navigation profiles for pointing devices#1351alexrzem wants to merge 1 commit into
Conversation
Finder and Safari never navigate on mouse buttons 4/5, so the MouseBack/MouseForward defaults are silently dead there — the classic "Back/Forward work in Chrome but not Finder" report (AprilNEA#1263, AprilNEA#354, AprilNEA#582). Logi Options+ closes the same gap with per-app overrides that send the apps' own Go/History shortcuts. Seed com.apple.finder and com.apple.Safari with BrowserBack/ BrowserForward (Cmd+[ / Cmd+]) for every pointing device, exactly once: on the first identity record for a device entry, and via a one-shot v7->v8 migration for existing configs. An app with any existing per-app entry is never touched, and a v8 file missing the profile is the user's deletion, not a gap to refill. Because the seeded actions differ from the Back/Forward defaults, the app-scoped capture plan HID++-diverts the buttons while Finder/Safari are frontmost, so dispatch does not depend on the OS hook attributing Bluetooth-direct mice (AprilNEA#722). Buttons 4/5 navigate natively in the stock file managers and browsers on Linux and Windows, so the seed is macOS-only.
|
| let device = self.devices.entry(device_key.to_string()).or_default(); | ||
| if device.identity.is_none() { | ||
| seed_navigation_profiles(device, identity.kind); | ||
| } |
There was a problem hiding this comment.
Provisional identity prevents seeding
When a device’s first persisted identity has DeviceKind::Unknown because its marketing-type probe was temporarily unavailable, this branch skips seeding but still records the identity. A later refresh that correctly identifies the device as a mouse cannot seed the profiles because device.identity is already populated. As a result, Back and Forward remain inactive in Finder and Safari for that device. The inventory persists measured capabilities independently of the provisional kind, and direct devices explicitly fall back to Unknown, so partial probing can reach this state.
Knowledge Base Used:
Summary
Back/Forward work in Chrome but do nothing in Finder or Safari: neither app implements mouse-button-4/5 navigation, and every driver that makes them work there (Logi Options+ included) synthesizes the app's own Go/History shortcut instead. This PR seeds the same two per-app overrides —
com.apple.finder/com.apple.Safari→BrowserBack/BrowserForward(⌘[ / ⌘]) — for every pointing device.Because the seeded actions differ from the Back/Forward defaults, the app-scoped capture plan HID++-diverts the buttons while those apps are frontmost, so dispatch does not depend on the OS hook attributing Bluetooth-direct mice (#722). Builds on #1225.
Changes
openlogi-core:seed_navigation_profiles, applied exactly once per device (first identity record) and once per config (v7→v8 migration). An app key with any existing per-app entry is never touched, and a v8 file missing the profile is the user's deletion, not a gap to refill. macOS-only — the stock file managers and browsers on Linux/Windows navigate on buttons 4/5 natively.SCHEMA_VERSION7 → 8;docs/config.example.tomlupdated.openlogi-desktop: five state tests moved offcom.apple.Safarionto neutral bundle ids (Safari now legitimately ships a built-in profile), plus a new test pinning the inventory → identity → seed path.Testing
cargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warnings(RUSTFLAGS=-D warnings),cargo test --workspace, and the non-GUI rustdoc gate — green on macOS arm64.cargo xtask ci: rustfmt, clippy, MSRV, rustdoc, macOS tests, windows clippy proxy, typos, wasm — pass. Not run locally: tests (linux), cargo-deny (no dependency changes), shell (no shell changes).--target aarch64-unknown-linux-musland--target x86_64-pc-windows-gnu— green.MouseBackposts a button 4/5 Finder ignores, and the default ⌘[ binding is never HID++-diverted so it dies in the fail-closed hook #1263's commenters confirmed working on hardware.Refs #1263, #354, #1118, #722
Fixes #582