Skip to content

Trackpad scrolling loses fractional motion and first mouse selection can miss focus #736

Description

@panosAthDBX

What happened?

On the latest tip, slow trackpad scrolling through terminal history is uneven and loses motion. The effect is more noticeable in full-screen terminal applications such as Claude Code. Mouse selection can also fail on the first drag after clicking an unfocused split or inactive terminal.

Expected behavior: precision-scroll deltas should carry their fractional remainder across events, and a click in an unfocused terminal should complete focus transfer without forwarding an unmatched press/release pair.

Investigation found two defects in the tip source:

  1. The pinned Ghostty Surface.scrollCallback computes amount = poff / cell_size, then stores poff - (amount * cell_size). Because amount is fractional, this resets the pending value to zero after every threshold crossing instead of retaining the remainder after the truncated row delta. The same defect exists on both axes.
  2. Supacode's copied AppKit focus handler predates Ghostty's focus-only click suppression and corrected content-view hit testing. It can forward the click while focus is still on another split and hit-test in the wrong coordinate space.

Steps to reproduce

  1. Install Supacode tip 0.10.6 (1784763905).
  2. Produce enough terminal output to create scrollback.
  3. Slowly scroll up and down with a trackpad using small, consistent gestures.
  4. Observe uneven row cadence and lost motion; repeat inside a full-screen terminal UI such as Claude Code.
  5. Create two terminal splits and focus the first split.
  6. Click-drag to select text in the second split.
  7. Observe that the first interaction can fail to focus/select cleanly.

Supacode version and build

0.10.6 (1784763905)

macOS version

macOS 26.5.2

System locale

en_GB

Mac hardware

Apple M5 Pro

Relevant logs or screenshots

No crash or log output. The scroll accumulator issue is deterministic: with a 16 px cell and repeated 7 px deltas, the current code emits rows on events 3, 6, and 9; preserving the remainder emits on events 3, 5, and 7 and retains 15 px.

Contribution

  • I intend to open a pull request once this is confirmed and marked ready.

Before submitting

  • I searched existing issues and this is not a duplicate.
  • I am on the latest available version of Supacode.
  • I understand pull requests are closed until the issue is marked ready.
  • I agree to follow this project's Code of Conduct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions