From 96e8fc3f1c8b6cdd012ea58640663a0b5daf80d2 Mon Sep 17 00:00:00 2001 From: Daneel Date: Mon, 23 Feb 2026 14:08:42 +0100 Subject: [PATCH] =?UTF-8?q?macos:=20fix=20mouse=20=E2=80=94=20scroll=20whe?= =?UTF-8?q?el=20works,=20movement=20doesn't=20move=20cursor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- config.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/config.el b/config.el index f70d6bc..6f21ae1 100644 --- a/config.el +++ b/config.el @@ -54,8 +54,8 @@ ;;; MACOS / PLATFORM ;;; ============================================================ -(setq mouse-autoselect-window t - focus-follows-mouse t +(setq mouse-autoselect-window nil ; don't switch window on mouse move + focus-follows-mouse nil ; don't change focus on mouse move select-enable-clipboard t select-enable-primary t inhibit-splash-screen t) @@ -168,6 +168,8 @@ Bound to cmd+v in org-mode and markdown-mode." mac-right-option-modifier 'none)) ;; 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) (dolist (key '([mouse-1] [mouse-2] [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] [down-mouse-1] [down-mouse-2] [down-mouse-3])) (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))