Revert "fix(scroll): enable pixel-scroll-precision-mode for smooth macOS trackpad scrolling"

This reverts commit 372e93fce4.
This commit is contained in:
2026-02-23 14:32:47 +01:00
parent 372e93fce4
commit 9bf41c045a

View File

@@ -180,23 +180,22 @@ Bound to cmd+v in org-mode and markdown-mode."
(global-set-key key #'ignore)) (global-set-key key #'ignore))
(setq mouse-highlight nil)) (setq mouse-highlight nil))
;; macOS smooth scrolling — pixel-scroll-precision-mode (Emacs 29+, works on NS/Cocoa) ;; macOS scroll wheel best practice (NS/Cocoa build):
;; pixel-scroll-precision-mode handles [wheel-up/down] → pixel-scroll-precision. ;; - pixel-scroll-precision-mode is NOT used: it targets X11/Haiku and breaks
;; ns-use-mwheel-momentum: macOS sends momentum-phase events after finger lift; ;; NS/Cocoa scroll event delivery (rebinds [wheel-up/down] to non-working handlers)
;; setting t passes them through so kinetic/inertial scrolling works. ;; - Standard mwheel.el with conservative settings is reliable on macOS
;; pixel-scroll-precision-use-momentum nil: let macOS handle momentum (Emacs ;; - NS backend converts trackpad + physical wheel to [wheel-up]/[wheel-down] events
;; momentum simulation would double-apply on top of NS momentum events).
(when (display-graphic-p) (when (display-graphic-p)
;; NS/macOS: honour trackpad kinetic (inertial) scrolling (require 'mwheel)
(setq ns-use-mwheel-momentum t) ;; 3 lines per scroll tick; shift = 1 line; no progressive acceleration
;; Horizontal scroll + follow-mouse still go through mwheel.el (setq mouse-wheel-scroll-amount '(3 ((shift) . 1) ((meta) . 0) ((control) . text-scale))
(setq mouse-wheel-follow-mouse t mouse-wheel-progressive-speed nil ; constant speed, no acceleration
mouse-wheel-tilt-scroll t) mouse-wheel-follow-mouse t ; scroll window under cursor
;; Pixel-precise vertical scrolling (Emacs 29+) mouse-wheel-tilt-scroll t ; horizontal scroll with tilt/two-finger
(when (fboundp 'pixel-scroll-precision-mode) mouse-wheel-flip-direction nil) ; standard direction (not natural)
(setq pixel-scroll-precision-use-momentum nil ; macOS provides its own momentum ;; Ensure mwheel-scroll is bound (Doom may remap these)
pixel-scroll-precision-large-scroll-height 40.0) (global-set-key [wheel-up] #'mwheel-scroll)
(pixel-scroll-precision-mode 1))) (global-set-key [wheel-down] #'mwheel-scroll))