macos: fix mouse — scroll wheel works, movement doesn't move cursor

- mouse-autoselect-window nil: mouse movement no longer switches
  active window (was the main cause of apparent cursor jumping)
- focus-follows-mouse nil: same — no focus change on hover
- mouse clicks still disabled ([mouse-1..3] → #'ignore)
- scroll wheel explicitly configured: 3 lines/tick, no acceleration,
  no progressive speed (mouse-wheel-scroll-amount)
This commit is contained in:
2026-02-23 14:08:42 +01:00
parent 312b6f0eab
commit 96e8fc3f1c

View File

@@ -54,8 +54,8 @@
;;; MACOS / PLATFORM ;;; MACOS / PLATFORM
;;; ============================================================ ;;; ============================================================
(setq mouse-autoselect-window t (setq mouse-autoselect-window nil ; don't switch window on mouse move
focus-follows-mouse t focus-follows-mouse nil ; don't change focus on mouse move
select-enable-clipboard t select-enable-clipboard t
select-enable-primary t select-enable-primary t
inhibit-splash-screen t) inhibit-splash-screen t)
@@ -168,6 +168,8 @@ Bound to cmd+v in org-mode and markdown-mode."
mac-right-option-modifier 'none)) mac-right-option-modifier 'none))
;; Fix C: Disable mouse clicks in GUI Emacs (prevent accidental cursor movement) ;; Fix C: Disable mouse clicks in GUI Emacs (prevent accidental cursor movement)
;; Scroll wheel ([wheel-up/down]) is intentionally NOT disabled — scrolling works.
;; Mouse movement does not move cursor (mouse-autoselect-window nil above).
(when (display-graphic-p) (when (display-graphic-p)
(dolist (key '([mouse-1] [mouse-2] [mouse-3] (dolist (key '([mouse-1] [mouse-2] [mouse-3]
[double-mouse-1] [double-mouse-2] [double-mouse-3] [double-mouse-1] [double-mouse-2] [double-mouse-3]
@@ -175,7 +177,11 @@ Bound to cmd+v in org-mode and markdown-mode."
[drag-mouse-1] [drag-mouse-2] [drag-mouse-3] [drag-mouse-1] [drag-mouse-2] [drag-mouse-3]
[down-mouse-1] [down-mouse-2] [down-mouse-3])) [down-mouse-1] [down-mouse-2] [down-mouse-3]))
(global-set-key key #'ignore)) (global-set-key key #'ignore))
(setq mouse-highlight nil)) (setq mouse-highlight nil)
;; Smooth scroll wheel: 3 lines per tick, no acceleration
(setq mouse-wheel-scroll-amount '(3 ((shift) . 1) ((control) . nil))
mouse-wheel-progressive-speed nil
mouse-wheel-follow-mouse t))