Keyboard shortcut is swallowed when synthetic gesture posting fails
#30 ouverte le 7 août 2026
Métriques du dépôt
- Stars
- (16 étoiles)
- Métriques de merge PR
- (Merge moyen 15h 17m) (11 PRs mergées en 30 j)
Description
Problem
The keyboard event tap swallows a matched Space shortcut even when posting the replacement DockSwipe fails.
In App/EventTap.swift, the left/right shortcut path calls postSwitchGesture(direction:) and records a switch only when it returns true, but then returns nil unconditionally. If event creation or posting fails, the original shortcut has already been swallowed and macOS never receives a native fallback.
Expected behavior
If the replacement gesture cannot be created or posted, the original key event should be passed through so macOS can perform its normal Space switch.
The expected control flow is:
- Successful synthetic gesture: record the switch and swallow the original event.
- Failed synthetic gesture: pass the original event through unchanged.
Why this matters
This is a fail-closed behavior at the input boundary: a rare allocation or posting failure can turn a recoverable instant-switch failure into a shortcut that appears to do nothing.
Suggested fix
Return the existing passthrough event when postSwitchGesture(direction:) returns false, while retaining the current edge-boundary behavior where the event is intentionally swallowed because there is no adjacent Space.
Verification
Exercise the failure path with a deterministic test seam or injected gesture-posting result. Confirm that the original key event reaches native macOS handling when synthetic posting fails.