Normalize Dock gesture activation across displays#77
Open
al1ych wants to merge 17 commits into
Open
Conversation
al1ych
force-pushed
the
codex/fix-high-refresh-gesture-velocity
branch
from
June 10, 2026 20:05
7b75857 to
b3d4e42
Compare
al1ych
force-pushed
the
codex/fix-high-refresh-gesture-velocity
branch
from
June 10, 2026 20:08
b3d4e42 to
743db83
Compare
al1ych
marked this pull request as draft
June 10, 2026 20:10
al1ych
marked this pull request as ready for review
June 11, 2026 01:10
Author
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
Normalas the original raw gesture behavior on every display: velocity40and near-zero progressNormalby the target display refresh rate relative to the slowest active displayBegan/Changedkeep animation velocity and animation progressEndedgets explicit commit velocity/progress so Dock activates the target Space immediatelyISSSpaceInfo.displayID, not by re-reading cursor position during gesture postingRoot cause
There are two separate Dock behaviors involved:
Began/Changedfields control perceived animation speedEndedfields control whether Dock commits/activates the target Space immediatelyUsing one set of fields for every phase either made animation speed diverge between displays or failed to activate the target Space immediately on one display. The current fix treats the final
Endedevent as an explicit commit phase while leavingChangedas the visual animation phase.The velocity fix treats
40as the invariant normal baseline and scales only the non-normal animation velocity offset:The commit phase then applies a separate floor:
baselineRefreshRateis the minimum active display refresh rate. If refresh rate lookup fails, scale falls back to1.0.Formula
On a baseline 120Hz display:
On a 240Hz display with 120Hz baseline:
Began, Instant, and high multi-space gestures keep near-zero progress.Commit evolution
88459e1introduced linear refresh-ratio scaling, but this still generated different activation behavior across displays.cc05f92used Instant velocity forEnded; it activated immediately but collapsed every speed option into Instant.2000f2crestored non-instant animation and added progress, but progress still differed by display because it was derived from refresh-scaled velocity.f6a0caeremoved refresh-dependent gesture generation and normalized all displays onto a shared Dock activation curve.07f681bwidened the non-instant curve, but the upper presets were still too close for perceived speed differences.7f605f6expanded the upper presets more aggressively, but Fast became too fast.6561c3bsoftened the curve and lowered fixed non-instant progress.3d0ec20slowed the whole non-instant curve further after all presets still felt too fast.8b8b7e5anchored Normal back to the original raw gesture and halved the remaining fast-preset curve.fe1bd65applies refresh-rate normalization only to the velocity offset above Normal, using the selected display's UUID.9a4b823applied refresh-rate normalization to all non-instant progress; this improved commit but made perceived speed diverge.510465alimited progress scaling toEnded, but the commit phase was still not explicit enough.f56c2eamakesEndeda dedicated commit phase with commit velocity floor and commit progress.Verification
swift test --disable-sandbox: 38 tests passed./dist/build.sh --debug: universal debug app built successfullybuild/InstantSpaceSwitcherDev.appcom.interversehq.InstantSpaceSwitcher.dev, stable Apple Development signing, andGitCommitHash f56c2eaFasteron the current 120Hz setup confirmed:Began:velocity=56,progress=FLT_TRUE_MINChanged:velocity=56,progress=0.09Ended:velocity=80,progress=0.352000Fixes #75