Skip to content

Cancel active gestures after event tap interruption - #30

Closed
KulmanD wants to merge 3 commits into
mainfrom
fix/reset-interrupted-gesture
Closed

Cancel active gestures after event tap interruption#30
KulmanD wants to merge 3 commits into
mainfrom
fix/reset-interrupted-gesture

Conversation

@KulmanD

@KulmanD KulmanD commented Jul 26, 2026

Copy link
Copy Markdown
Owner

What changed

  • cancels active gesture state when either mapped event tap is disabled by timeout or user input
  • disables the movement tap through the existing gesture activity callback before tap recovery decides whether re-enabling is appropriate
  • keeps recovery idempotent and never posts an action
  • adds focused interruption and 12,000-cycle repeated-recovery tests
  • records the isolated performance decision in docs/performance/reset-interrupted-gesture.md

Why

A lost button-up during an event-tap interruption could otherwise leave gesture state active and pointer movement suppressed.

Testing

  • swift build and swift build -c release
  • GitHub Actions: 37 tests, 0 failures
  • three paired 150-second strict-idle runs
  • repeated 12,000-event inactive and active pointer workloads
  • 12,000 direct recovery cycles in the focused test target
  • complete app and lightweight source archive verification
  • lifecycle start/status/stop check with no remaining process

Performance

  • release helper: +160 bytes (+0.037%)
  • zero package-idle and interrupt-wakeup growth in all six idle runs
  • two persistent worker threads in all idle runs
  • no systematic CPU, RSS, or physical-footprint regression
  • no timer, polling, persistent allocation, normal logging, network access, or additional persistent thread

Limitations and follow-up

No matching MX Master was detected during measurement, so physical timeout/reconnect behavior remains part of the required #21 + #23 interaction branch. This PR remains draft and must not be merged until that interaction gate passes.

Closes #21

KulmanD commented Jul 26, 2026

Copy link
Copy Markdown
Owner Author

Superseded by draft PR #40, which contains this change, its performance evidence, the complete accepted integration, and passing final CI. Closing this draft without merging avoids duplicate commits. The branch is intentionally retained for isolated comparison and deferred measurements.

@KulmanD KulmanD closed this Jul 26, 2026
@KulmanD
KulmanD deleted the fix/reset-interrupted-gesture branch July 27, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fail safely when an event tap interrupts an active gesture

1 participant