Fix trackpad fractional-scroll loss and first-click focus in splits - #741
Merged
sbertix merged 2 commits intoJul 30, 2026
Merged
Conversation
Surface.scrollCallback stored `poff - amount * cell_size` as the pending scroll, but `amount = poff / cell_size`, so that expression equals `poff` and the sub-row remainder was zeroed on every threshold crossing, making slow trackpad scrolls lose motion. Truncate to whole rows first and carry `poff - trunc(amount) * cell_size` instead, on both axes. Delivered as an out-of-tree patch applied at build time; the submodule pin is untouched.
A left click on an unfocused split while the app and window are already active only transfers focus, but the click was forwarded to the terminal, leaking a press (and later an orphaned release) that broke the first drag-select. Consume that click and gate every terminal release on a press this view actually sent, so neither a same-split click nor a drag that presses in one split and releases in another can orphan a release. Hit-test in content-view space so the check still holds when the surface is scrolled into scrollback (its frame origin tracks the scroll offset), gate focus on the window's first responder rather than a cached bit, and reset Force Touch pressure on the swallowed release.
sbertix
enabled auto-merge (squash)
July 30, 2026 12:51
sbertix
deleted the
sbertix/gh-736-trackpad-scrolling-loses-fractional-moti
branch
July 30, 2026 13:13
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.
Closes #736
Summary
Two independent input defects from the issue:
Surface.scrollCallbackstored
poff - amount * cell_sizeas the pending scroll, butamount = poff / cell_size, so that expression equalspoffand the sub-rowremainder was zeroed on every row emitted. Slow trackpad scrolls lost motion
(with a 16px cell and repeated 7px deltas, rows landed on events 3/6/9 instead
of 3/5/7). Fixed by truncating to whole rows first and carrying
poff - trunc(amount) * cell_size, on both axes. Shipped as an out-of-treepatch applied at build time; the ghostty submodule pin is untouched.
while the app and window are already active only transfers focus, but the click
was forwarded to the terminal, leaking a press (and later an orphaned release)
that broke the first drag-select. The click is now consumed for focus transfer,
and every terminal release is gated on a press this view actually sent, so
neither a same-split click nor a drag that presses in one split and releases in
another orphans a release. Hit-testing now happens in content-view space so the
check holds when the split is scrolled into scrollback, focus is gated on the
window's first responder rather than a cached bit, and Force Touch pressure is
reset on the swallowed release.
Type of change
ready)How was this tested?
make checkpasses (format + lint)make testpassesChecklist
Closes #above.ready.