fix(animation): animate both paws concurrently (#78)#79
Open
Aestylis wants to merge 6 commits into
Open
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The keycode ring + eventfd now cover code delivery and wake-up, so the single shared last_key_code, the any_key_pressed flag, and animation_trigger are removed. This also eliminates the multi-monitor reset race where each monitor process cleared the shared any_key_pressed flag. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <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.
Fixes #78.
Problem
Only one paw animates at a time. Pressing a left-side and a right-side key together moves just one paw (the last pressed) — the
both-downframe is never shown.Root cause
The input child overwrites a single shared
last_key_code, and the animation thread maps that one code to frame 1 or 2 with a singlehold_until. The existingbongo-both-down.svgframe is unreachable.Approach
The issue suggested separate surfaces per paw. Since the artwork is whole-cat frames (including an existing
both-downframe) rather than isolated paw layers, I took a lighter route that needs no new surfaces or art:both-down).last_key_code/any_key_pressed, which also fixes a multi-monitor reset race on the old shared flag.Testing
make test,make format-check,make releaseall clean.Net: +337/−141 across 11 files; no new dependencies; ~260 bytes shared memory (removes two prior mmaps).