Pass native pinch gestures through on Fusion - #4
Open
SnackForever wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds DaVinci Resolve “Fusion page” detection via Accessibility polling so ResolveZoom can pass native pinch gestures through when Fusion is active, while preserving the existing magnify→Option-scroll behavior on other pages.
Changes:
- Introduces a periodic, bounded AX-tree scan (off the event-tap hot path) to infer Resolve’s active page.
- Uses the detected page to pause gesture interception on Fusion and resume elsewhere.
- Updates README to document Fusion-aware behavior and polling/performance characteristics.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ResolveZoom/AppDelegate.swift | Adds Fusion page polling/scan pipeline and uses it to bypass magnify conversion while Fusion is active. |
| README.md | Documents Fusion-aware pinch handling and the background polling approach. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.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.
Summary
This PR adds focused Fusion-page detection so ResolveZoom passes native pinch
gestures through while DaVinci Resolve's Fusion page is active.
Fusion already handles pinch zoom natively. On the other Resolve pages,
ResolveZoom keeps the existing magnify-to-Option-scroll conversion used for
timeline zoom.
Why Accessibility polling
Resolve does not expose its active page through a public API.
Testing with Accessibility Inspector showed that Resolve exposes the page tabs
as
AXCheckBoxelements:The selected page has
AXValue == 1.The tab label is not reliably exposed in
AXTitle; Resolve stores it inAXDescription, so the scan usesAXTitlefirst and falls back toAXDescription.AXObserverwas considered, but it is not reliable here: Resolve's Qt UI candestroy and recreate Accessibility elements when pages change, invalidating
observer references. Polling from a freshly acquired window tree is therefore
the more robust approach.
Safety and performance
The original proof of concept used a main-run-loop timer and performed AX work
synchronously. That is unsafe because each
AXUIElementCopyAttributeValuecall is synchronous IPC into Resolve; a busy Resolve process can delay it for
seconds and block the event tap.
This implementation avoids that path entirely:
DispatchSourceTimerschedules a lightweight poll every second. Runtimetesting showed that a run-loop
Timercould be delayed until a focus ordesktop change; the dispatch timer keeps scheduling independent of those
run-loop modes.
.utilityqueue.AXUIElementSetMessagingTimeout(..., 0.05)is applied before each AXrequest.
kAXErrorCannotComplete, aborts the current scanrather than continuing through the tree.
overlapping scan updates.
If Resolve is loading or its AX server is unavailable, the last confirmed
state is retained. This avoids accidentally re-enabling interception while
Fusion is still loading.
Validation
Manual testing confirmed:
AI disclosure
This implementation and PR description were produced with assistance from
GPT-5.6 running in Zed. The human contributor performed the DaVinci Resolve
runtime testing, reported behavior and logs, and reviewed the intended scope.