Repository navigation
fix: warn about another app only when it sends to the pad - #21
Merged
Merged
Conversation
An app that holds the pad's vendor interface without sending (Work Louder's Input running in the background) raised the warning on every launch, since any other client in an authoritative scan raised it and start() forgot what Recheck had acknowledged. Only foreign replies raise the warning now. The registry scan lays a reply at the newcomers (other clients not seen holding the pad quietly), names them, and clears the warning once they have gone, so the Inspector round trip still clears by itself while Input keeps running. acknowledgedPIDs is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Input sends host.focused_app to the pad on every frontmost-app change, and
the firmware answers it with a bare null. The reply after the Inspector quit
found only Input in the registry, so it was blamed and the warning stayed
until Recheck. A foreign reply with a null result is not about the lighting
(lighting calls answer {"ok":1}), so it is now ignored, after the own-id
check. PadEmulator answers host.focused_app with null, as the device does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Right after launch, with no other app open, the panel showed "Also driving this pad: input — colours may fight." Recheck cleared it until the next launch. With the Inspector open it read "input, Micro Manager Inspector". After the first commit fixed that, a second issue showed up: opening and then quitting the Inspector left "Also driving this pad: input" up until Recheck.
Cause
Work Louder's Input (
/Applications/input.app) keeps running in the background after its window is closed, and it caused both issues:ioreg:"pid 24802, input"underPrimaryUsagePage65280). Phase 3 raised the warning for any other client in an.authoritativescan, andstart()forgets what Recheck acknowledged, so the warning came back on every launch.host.focused_appon every frontmost-app change, and the firmware answers with a bare"result": null. A live probe showed this: a test process holding the pad logged every reply and scan, first while the Inspector was opened and quit, then while only the frontmost app was switched. Every switch produced a foreign reply with a random id and a null result; the probe's ownhost.focused_appgot the same null back. The reply that came after the Inspector quit found only Input in the scan, so it was blamed on Input, and Input stays running.Fix
{"ok":1}, so a null reply cannot be a fight over the colours. The filter runs after the own-id check, so our own ids are still consumed. Error replies still count.suspectedPIDskeeps a Recheck with the Inspector still open from marking the Inspector as quiet.acknowledgedPIDsis removed, along with the bridge's distinction between.authoritativeand.advisory. Recheck's help text is updated.PadEmulatoranswershost.focused_appwithnull, as the device does.BridgeContentionTestsis rewritten for the new rules (29 tests). Every mutation listed indesign/pad-contention.mdis caught.docs/hacking.mdanddesign/pad-contention.mdare updated. The design doc records both bugs, the probe findings and the known limits.Testing
swift build -c releasehas zero warnings.env -u HERDR_SOCKET_PATH swift test: two runs on the final commit, both green (239 tests, 2 skipped). Earlier, on the first commit, one of seven runs had a single failure. Its test name was lost to output filtering and it did not come back. That run had the real pad and the installed app running, so the failure was likely in aLive*test; this is not confirmed.User checks (not done in-session)
🤖 Generated with Claude Code