diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-10-02 10:08:46 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-10-02 10:08:51 -0700 |
commit | e773492fd0626edd09ea5e2ae5a4e3e591279585 (patch) | |
tree | dab0908caf40bbfc6e5b8cddc7b4ea1b052ca727 | |
parent | b3796115d7c835c98fd1dcbb9509b784fac81542 (diff) | |
download | dotfiles-e773492fd0626edd09ea5e2ae5a4e3e591279585.tar.gz |
disable mouse-autoselect-window
-rw-r--r-- | .emacs.d/early-init.el | 13 | ||||
-rw-r--r-- | .emacs.d/init.el | 3 |
2 files changed, 10 insertions, 6 deletions
diff --git a/.emacs.d/early-init.el b/.emacs.d/early-init.el index 6836c35a..c3d67b50 100644 --- a/.emacs.d/early-init.el +++ b/.emacs.d/early-init.el @@ -31,8 +31,10 @@ won't be found." ;; 'emacsclient --spw/update-environment' supplies us with I3SOCK, so if we ;; see that variable we know there is at least one frame under i3 or swaywm, -;; and so we want to set `mouse-autoselect-window' and `focus-follows-mouse' -;; to t. As we can't do that frame-locally, once they're set they're set. +;; and so we want to set `focus-follows-mouse' to t. As we can't do that +;; frame-locally, once it's set it's set. (I used to set +;; `mouse-autoselect-window' to t too, but it often caused unwanted focus +;; changes, and it makes the tool and menu bars much fiddlier to use.) ;; ;; On the other hand, ideally functions like `spw/save-buffer-for-later' ;; decide whether to open a new frame or a new tab frame-locally, so we used @@ -46,14 +48,15 @@ won't be found." (not (setq spw/tiling-wm-p (or (getenv "I3SOCK") (getenv "SWAYSOCK"))))) (setq focus-follows-mouse t - mouse-autoselect-window t + ;; mouse-autoselect-window t desktop-restore-forces-onscreen nil) ;; Disable `mouse-autoselect-window' during `display-buffer', to avoid ;; surprise focus changes -- some code that calls `display-buffer' does ;; not expect `mouse-autoselect-window' to be on. E.g. `magit-status' can ;; leave focus in the wrong window without this. - (advice-add 'display-buffer - :around #'spw/disable-mouse-autoselect-window)) + ;; (advice-add 'display-buffer + ;; :around #'spw/disable-mouse-autoselect-window) + ) ;; If X or Sway, we know we have a usable primary selection, so we used to ;; turn off additionally copying to the clipboard. However, we do want to ;; be able to yank from the clipboard. See also NEWS.24. diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 8c864913..54f81818 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -4629,7 +4629,8 @@ We don't use the FILES parameter in the entry for \"d\" in (cl-case major-mode (c-mode (call-interactively 'gdb) - (setq mouse-autoselect-window t)) + ;; (setq mouse-autoselect-window t) + ) (cperl-mode (call-interactively 'perldb)) (python-mode |