Skip to content

Fix speedy high-resolution scrolling on Linux - #12483

Merged
mitchellh merged 2 commits into
ghostty-org:mainfrom
rightaditya:fix-hires-scroll
Apr 27, 2026
Merged

mitchellh merged 2 commits into
ghostty-org:mainfrom
rightaditya:fix-hires-scroll

Conversation

@rightaditya

Copy link
Copy Markdown
Contributor

Enforcing an absolute minimum of 1 for scroll events causes differing scroll speeds between high-resolution and standard scroll wheels on Linux. Since this was added to handle MacOS's precision scrolling emulation, this patch alters the behaviour so that the absolute minimum is only enforced on MacOS.

NB: This can't just be fixed by adjusting mouse-scroll-multiplier since that affects all scroll events whether they're high-resolution or not. Reducing mouse-scroll-multiplier to handle high-res scroll events better makes scrolling unusably slow for regular scroll wheels connected to the same machine.

Fixes #11648.

@rightaditya
rightaditya requested a review from a team as a code owner April 26, 2026 23:13
@mitchellh mitchellh added the input Keyboard or mouse input label Apr 27, 2026
@mitchellh mitchellh added this to the 1.4.0 milestone Apr 27, 2026
@mitchellh

Copy link
Copy Markdown
Contributor

Can you run zig fmt in here to fix that up?

Other than that I'm fine giving this a shot.

Enforcing an absolute minimum of 1 for scroll events causes differing
scroll speeds between high-resolution and standard scroll wheels on
Linux. Since this was added to handle MacOS's precision scrolling
emulation, this patch alters the behaviour so that the absolute minimum
is only enforced on MacOS.

Fixes ghostty-org#11648.
@mitchellh

Copy link
Copy Markdown
Contributor

Thanks, also, I know zig fmt is easy to run, but I do a lot of PR review on mobile so... I can't actually do it lol.

@rightaditya

Copy link
Copy Markdown
Contributor Author

@mitchellh My bad. Done and rebased.

@mitchellh
mitchellh merged commit 6590196 into ghostty-org:main Apr 27, 2026
16 checks passed
@rightaditya

Copy link
Copy Markdown
Contributor Author

And thanks, likewise. I don't have a Mac so I couldn't test it there, but the change seemed innocuous enough to at least be worth trying.

Meo98 added a commit to Meo98/meos-nixos-config that referenced this pull request Sep 16, 2026
Der bisherige Text behandelte 'patch does not apply' als sauberes Verfalls-
signal fuer den GANZEN Patch. Der ghostty-Fall zeigt, dass Hunks unabhaengig
voneinander verfallen koennen: ghostty-hires-scroll.patch hat drei Hunks,
Hunk 1 wurde upstream mit derselben Loesung behoben (ghostty-org/ghostty#12483,
gemergt 2026-04-27), Hunk 2 und 3 sind in main unveraendert offen und ohne PR.
Beim naechsten ghostty-Bump ueber v1.3.1 haette die Automatik zwei gueltige
Fixes mit weggeraeumt.

Neue Regel: hunkweise erneut anwenden; nur Hunks entfernen, die 'previously
applied' melden; Kontext-Fehlschlaege sind ein echter Blocker (der Agent
rebast nicht im Alleingang); Registereintrag nur loeschen wenn alles verfiel.
Meo98 added a commit to Meo98/meos-nixos-config that referenced this pull request Sep 16, 2026
…cht)

Recherche zum ghostty-scroll-fix-Overlay: von den drei gepatchten Befunden
hat upstream Befund 1 (Klemmung @max(yoff,1) auch auf Linux) selbst behoben
- PR ghostty-org/ghostty#12483, gemergt 2026-04-27, mit derselben Loesung.
v1.3.1 ist aber vom 2026-03-13 und seither neuester Tag, liegt also 862
Commits vor dem Fix -> unser Overlay braucht ihn weiterhin.

Befund 2 (Sub-Zeilen-Rest wird verworfen, weil amount*cell_size wieder poff
ergibt) und Befund 3 (x-Achse rundet Hi-Res-Ticks per @round auf null, ohne
Akkumulator) sind in main unveraendert offen, ohne offenen PR.

Beide als Patches gegen main (d4c88d8) vorbereitet, mit zig 0.16 ast-check
geprueft inkl. Rot-Nachweis. NICHT eingereicht: ghostty hat ein Vouch-System,
Meo98 steht nicht auf .github/VOUCHED.td, ungevouchte PRs werden automatisch
geschlossen. Der Vouch-Request muss laut CONTRIBUTING.md in eigener Stimme
geschrieben werden.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

input Keyboard or mouse input

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants